Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [PERFORM] multicolumn index column order

From: Lew <lew(at)lewscanon.nospam>
Date: Fri Jul 27 2007 - 16:03:11 EDT


valgog wrote:

> On Jul 25, 2:14 am, Lew  wrote:

>> How about two indexes, one on each column? Then the indexes will cooperate
>> when combined in a WHERE clause.
>> <http://www.postgresql.org/docs/8.2/interactive/indexes-bitmap-scans.html>
>>
>> I don't believe the index makes a semantic difference with regard to ascending
>> or descending. An index is used to locate records in the selection phase of a
>> query or modification command.
>>
>> --
>> Lew
> 
> Ordered indexes (b-tree in this case) are also used to get the needed
> record order and it is absolutely not necessary to have a WHARE clause
> in your select statement to use them when you are using ORDER BY.

But does that affect anything when you "ORDER BY foo ASC" vs. when you "ORDER BY foo DESC"?

For use by ORDER BY, separate column indexes are an even better idea.

-- 
Lew

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly
Received on Mon Jul 30 16:59:40 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:46:54 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library