Re: Multicolumn indexes and ORDER BY

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

Yes i tried that already - and as you said, it works. But i need to have one
column sorted DESC and one ASC. Is there any way this could be done ?

Regards,
Jernej Kos.

On Wednesday 16 of June 2004 08:12, Martijn van Oosterhout wrote:
> On Wed, Jun 16, 2004 at 07:12:26AM +0200, Jernej Kos wrote:
> > 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 ?
>
> Try:
>
> ORDER BY col1 DESC, col2 desc;
>
> Hope this helps,

--
Jernej Kos <kostko(at)jweb-network(dot)net>
JWeb-Network

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Parker 2004-06-16 13:40:49 Re: building 7.4.3 on Solaris 9/Intel
Previous Message Achilleus Mantzios 2004-06-16 12:18:26 Re: How to delete the not DISTINCT ON entries