X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0F3899DC9DB for ; Fri, 24 Mar 2006 00:33:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09186-01 for ; Fri, 24 Mar 2006 00:32:59 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B52AF9DC9AC for ; Fri, 24 Mar 2006 00:32:58 -0400 (AST) Received: from mx1.vodamail.co.za (mx1.vodamail.co.za [196.11.146.148]) by svr4.postgresql.org (Postfix) with ESMTP id 3CEB05AF9B9 for ; Fri, 24 Mar 2006 04:32:57 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by mx1.vodamail.co.za (Postfix) with ESMTP id 3793A4ACAD for ; Fri, 24 Mar 2006 06:32:51 +0200 (SAST) Received: from mx1.vodamail.co.za ([127.0.0.1]) by localhost (mx1.vodamail.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25186-10 for ; Fri, 24 Mar 2006 06:32:49 +0200 (SAST) Received: from josh.flame2.flame.co.za (unknown [10.50.171.33]) by mx1.vodamail.co.za (Postfix) with ESMTP id B125E4D10E for ; Fri, 24 Mar 2006 06:32:48 +0200 (SAST) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by josh.flame2.flame.co.za (8.12.11/8.12.11) with ESMTP id k2O4WUGX004174 for ; Fri, 24 Mar 2006 06:32:32 +0200 Subject: Re: Indexes with descending date columns From: Theo Kramer Reply-To: theo@flame.co.za To: pgsql-performance@postgresql.org In-Reply-To: <20060323141622.GC4881@surnet.cl> References: <200603170625.k2H6PJ926955@pillette.com> <1143112188.2810.27.camel@theo-laptop.int.coza.net.za> <20060323141622.GC4881@surnet.cl> Content-Type: text/plain Organization: Flame Computing Enterprises cc Message-Id: <1143174749.2820.2.camel@josh> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 24 Mar 2006 06:32:29 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at vodamail.co.za X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.08 required=5 tests=[AWL=0.080] X-Spam-Score: 0.08 X-Spam-Level: X-Archive-Number: 200603/478 X-Sequence-Number: 17915 On Thu, 2006-03-23 at 16:16, Alvaro Herrera wrote: > Theo Kramer wrote: > > > All good input - thanks, however, before I start messing with my stuff > > which I know will be complex - some questions to any of the developers > > on the list. > > > > i Is it feasible to extend index creation to support descending > > columns? ... this is supported on other commercial and non > > commercial databases, but I do not know if this is a SQL standard. > > This can be done. You need to create an operator class which specifies > the reverse sort order (i.e. reverse the operators), and then use it in > the new index. Hmmm, would that then result in the following syntax being valid? create index my_idx on my_table (c1, c2 desc, c3, c4 desc) ; where my_table is defined as create table my_table ( c1 text, c2 timestamp, c3 integer, c4 integer ); If so, I would appreciate any pointers on where to start on this - already fumbling my way through Interfacing Extensions To Indexes in the manual... Regards Theo -- Regards Theo