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 6E3F2D1B2E6 for ; Thu, 29 Jul 2004 14:58:08 -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 83490-08 for ; Thu, 29 Jul 2004 17:58:05 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id C2BA6D1B182 for ; Thu, 29 Jul 2004 14:58:02 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1BqFAB-0000or-00; Thu, 29 Jul 2004 13:57:55 -0400 To: "Merlin Moncure" Cc: , "Greg Stark" , "Tom Lane" Subject: Re: best way to fetch next/prev record based on index References: <6EE64EF3AB31D5448D0007DD34EEB34101AF0F@Herge.rcsinc.local> In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AF0F@Herge.rcsinc.local> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 29 Jul 2004 13:57:55 -0400 Message-ID: <877jsmr90c.fsf@stark.xeocode.com> Lines: 21 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/227 X-Sequence-Number: 7618 "Merlin Moncure" writes: > Well, if and when the rowtype comparison can be made to work over multi > part keys (and the optimizer is made to do tricks there), postgres can > be made to give much better generalized ISAM access. In the meantime, > I'll just troubleshoot specific cases via application specific behavior > as they come up. In any case, many thanks to Greg and Tom for taking > the time to pick this apart. Well I'm not sure whether you caught it, but Tom did come up with a work-around that works with the current infrastructure if all the columns involved are the same datatype. You can create a regular btree index on the expression array[a,b,c] and then do your lookup using array[a,b,c] > array[a1,b1,c1]. This will only work in 7.4, not previous releases, for several reasons. -- greg