Re: index suggestion for 7.4

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: index suggestion for 7.4
Date: 2003-05-30 17:32:39
Message-ID: 10518.1054315959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruno Wolff III <bruno(at)wolff(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-05-30 17:42:24 Re: index suggestion for 7.4
Previous Message Jeff 2003-05-30 16:06:58 Re: Practical sets of SQLSTATE values?