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

Поиск
Список
Период
Сортировка
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)