X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 97DEE52894 for ; Mon, 23 May 2005 17:19:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97810-10 for ; Mon, 23 May 2005 20:18:57 +0000 (GMT) Received: from pillette.com (adsl-67-119-5-202.dsl.snfc21.pacbell.net [67.119.5.202]) by svr1.postgresql.org (Postfix) with ESMTP id 2AC3A528AF for ; Mon, 23 May 2005 17:18:55 -0300 (ADT) Received: from [192.168.1.202] (dhcp202.pillette.com [192.168.1.202]) by pillette.com (8.11.6/8.11.6) with ESMTP id j4NKIma31583; Mon, 23 May 2005 13:18:48 -0700 Message-ID: <42923CA3.1040306@pillette.com> Date: Mon, 23 May 2005 13:27:15 -0700 From: Andrew Lazarus Reply-To: andrew@pillette.com Organization: Pillette Investment Management User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yves Vindevogel Cc: pgsql-performance@postgresql.org Subject: Re: Fwd: Index on table when using DESC clause References: <6d31bed04ab35cbbe2df37af979d9882@implements.be> In-Reply-To: <6d31bed04ab35cbbe2df37af979d9882@implements.be> Content-Type: multipart/mixed; boundary="------------030207000207030307050007" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.122 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/346 X-Sequence-Number: 12510 This is a multi-part message in MIME format. --------------030207000207030307050007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit As far as I know, to use a straight index Postgres requires either ORDER BY pages, description -- or -- ORDER BY pages DESC, description DESC. If you want the results by pages DESC, description ASC, then you have to make an index on an expression or define your own operator or something esoteric like that. I would think the ability to have an index where the columns don't all collate in the same direction would be an easy feature to add. --------------030207000207030307050007 Content-Type: text/x-vcard; charset=utf-8; name="andrew.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="andrew.vcf" begin:vcard fn:Andrew Lazarus n:Lazarus;Andrew org:Pillette Investment Management;Research and Development adr;dom:;;3028 Fillmore;San Francisco;CA;94123 email;internet:andrew@pillette.com title:Director tel;work:800-366-0688 tel;fax:415-440-4093 url:http://www.pillette.com version:2.1 end:vcard --------------030207000207030307050007--