possible bug with compound index.

From: Neil Dugan <postgres(at)butterflystitches(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: possible bug with compound index.
Date: 2005-02-14 03:47:20
Message-ID: 1108352841.5086.23.camel@postgresql.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using PostgreSQL 7.4.7
I have a table with serveral fields two of these are a serialno
(bigserial) and name(varchar). I have created two indexs on these
fields.
1) on name
2) on name,serialno
if I use the command
'select * from table order by name limit 1'
everything is OK
if I use the command
'select * from table order by name desc limit 1'
everything is OK
if I use the command
'select * from table order by name,serialno limit 1'
everything is OK
if I use the command
'select * from table order by name,serialno desc limit 1'
The command is SLOW and gives back the INCORRECT data.
Doing an 'explain' on the above query says that the index wasn't used.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2005-02-14 04:40:28 Re: possible bug with compound index.
Previous Message Guy Thornley 2005-02-14 03:32:55 Index search order hints for R-Tree indexes