Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id F18479FBC10 for ; Wed, 25 Jul 2007 05:34:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 64978-06 for ; Wed, 25 Jul 2007 05:33:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id E23379FBAED for ; Wed, 25 Jul 2007 05:34:02 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 57D9A31418; Wed, 25 Jul 2007 10:34:01 +0200 (MET DST) From: valgog X-Newsgroups: pgsql.performance Subject: Re: multicolumn index column order Date: Wed, 25 Jul 2007 08:34:00 -0000 Organization: http://groups.google.com Lines: 20 Message-ID: <1185352440.504985.282370@19g2000hsx.googlegroups.com> References: <200707240710.l6O7AUu24090@pillette.com> <3ce9822f0707240040o2f358155p7ff7537bbe986209@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Complaints-To: groups-abuse@google.com In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 19g2000hsx.googlegroups.com; posting-host=62.220.8.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.091 tagged_above=0 required=5 tests=AWL=0.090, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/335 X-Sequence-Number: 26019 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. > > > 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. -- Valentine