Re: index suggestion for 7.4 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: index suggestion for 7.4
Date
Msg-id 10518.1054315959@sss.pgh.pa.us
Whole thread Raw
In response to index suggestion for 7.4  (Bruno Wolff III <bruno@wolff.to>)
List 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


pgsql-hackers by date:

Previous
From: Jeff
Date:
Subject: Re: Practical sets of SQLSTATE values?
Next
From: Stephan Szabo
Date:
Subject: Re: index suggestion for 7.4