Multicolumn indexes and ORDER BY

From: Jernej Kos <kostko(at)jweb-network(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Multicolumn indexes and ORDER BY
Date: 2004-06-16 05:12:26
Message-ID: 200406160712.26939.kostko@jweb-network.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a multicolumn index on two columns. If i use the columns in ORDER BY
like this:
ORDER BY col1, col2;

The index is used. But, if one column is sorted DESC it is not used:
ORDER BY col1 DESC, col2;

How can i make this work ?

Regards,
Jernej Kos.
--
Kostko <kostko(at)jweb-network(dot)net>
JWeb-Network

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Smith 2004-06-16 05:24:30 Re: Installation problem - mutex_lock/unlock or libpq.so ?
Previous Message Tom Lane 2004-06-16 04:21:00 Re: "Interesting" query planning for timestamp ranges in where clause?