Re: Multicolumn indexes and ORDER BY - Mailing list pgsql-general

From Jernej Kos
Subject Re: Multicolumn indexes and ORDER BY
Date
Msg-id 200406161539.35947.kostko@jweb-network.net
Whole thread Raw
In response to Re: Multicolumn indexes and ORDER BY  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Multicolumn indexes and ORDER BY
List 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@jweb-network.net>
JWeb-Network

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: 7.4 performance issue
Next
From: "David Parker"
Date:
Subject: Re: building 7.4.3 on Solaris 9/Intel