CREATE INDEX .. ON table1 (field1 asc, field2 desc) - Mailing list 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 by date:

Previous
From: Steve Lane
Date:
Subject: Why is pgbench suddenly slow?
Next
From: Bruno Wolff III
Date:
Subject: Re: CREATE INDEX .. ON table1 (field1 asc, field2 desc)