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 E8719D1CA97 for ; Wed, 28 Jul 2004 00:28:45 -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 04682-02 for ; Wed, 28 Jul 2004 03:28:41 +0000 (GMT) Received: from www.postgresql.com (www.postgresql.com [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id E69B2D1CB85 for ; Wed, 28 Jul 2004 00:22:12 -0300 (ADT) Received: from tht.net (vista.tht.net [216.126.88.2]) by www.postgresql.com (Postfix) with ESMTP id 4F24FCF689C for ; Tue, 27 Jul 2004 11:36:58 -0300 (ADT) Received: from [134.22.68.4] (dyn-68-4.tor.dsl.tht.net [134.22.68.4]) by tht.net (Postfix) with ESMTP id D906876B20; Tue, 27 Jul 2004 10:36:36 -0400 (EDT) Subject: Re: best way to fetch next/prev record based on index From: Rod Taylor To: Merlin Moncure Cc: Postgresql Performance In-Reply-To: <6EE64EF3AB31D5448D0007DD34EEB34101AEF5@Herge.rcsinc.local> References: <6EE64EF3AB31D5448D0007DD34EEB34101AEF5@Herge.rcsinc.local> Content-Type: text/plain Message-Id: <1090938993.83536.85.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 27 Jul 2004 10:36:34 -0400 Content-Transfer-Encoding: 7bit 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/197 X-Sequence-Number: 7588 You only want one record to be returned? Tack a LIMIT 1 onto the end of the query. > My problem is deceptively simple: how you read the next record from a > table based on a given set of values? In practice, this is difficult to > implement. If anybody can suggest a alternative/better way to this, I'm > all ears.