CREATE INDEX .. ON table1 (field1 asc, field2 desc)

Поиск
Список
Период
Сортировка
От Timur
Тема CREATE INDEX .. ON table1 (field1 asc, field2 desc)
Дата
Msg-id 18037029115.20020824201825@sdf.lonestar.org
обсуждение исходный текст
Ответы Re: CREATE INDEX .. ON table1 (field1 asc, field2 desc)  (Bruno Wolff III <bruno@wolff.to>)
Re: CREATE INDEX .. ON table1 (field1 asc, field2 desc)  (Alvaro Herrera <alvherre@atentus.com>)
Re: CREATE INDEX .. ON table1 (field1 asc, field2 desc)  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hello!

I am new to PostgreSQL and databases in general, and I have this
question: why it is not possible to specify ordering when creating an
index?

Let's say I have a query which looks like this:
SELECT * FROM table1
ORDER BY field1, field2 DESC
LIMIT 100;

Apparently, system won't use index ON (field1, field2) ..

I think it is pretty simple and hope there is a way to create index
with field2 indexed in descending order..

Thanks in advance.

Timur V. Irmatov.


В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Lane
Дата:
Сообщение: Why is pgbench suddenly slow?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: CREATE INDEX .. ON table1 (field1 asc, field2 desc)