Search Postgresql Archives

possible bug with compound index.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

 



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux