Re: index suggestion for 7.4
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-hackers@postgresql.org
Date: 2003-05-30T17:32:39Z
Lists: pgsql-hackers
Bruno Wolff III <bruno@wolff.to> writes: > Now that expressions can be used in indexes in 7.4 you can have multicolumn > indexes that are ordered in different directions. However the planner > doesn't seem to understand that order by -col asc is the same as order by > col desc (for at least the normal -) I don't think it should; that's an extremely datatype-dependent bit of analysis, and the planner does not have any means of ascertaining whether the equivalency holds for a particular "-" operator and index opclass. The correct way to set up this sort of thing would be to build a "backwards ordering" operator class, not to use an index on "-col". regards, tom lane