Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 00C289FA4F4 for ; Tue, 3 Oct 2006 14:01:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 56098-01 for ; Tue, 3 Oct 2006 17:01:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 509939FB26A for ; Tue, 3 Oct 2006 14:01:08 -0300 (ADT) Received: (qmail 5902 invoked by uid 500); 3 Oct 2006 17:11:25 -0000 Date: Tue, 3 Oct 2006 12:11:25 -0500 From: Bruno Wolff III To: Alexander Ilyin Cc: pgsql-sql@postgresql.org Subject: Re: How to FindNearest Message-ID: <20061003171125.GA5744@wolff.to> Mail-Followup-To: Bruno Wolff III , Alexander Ilyin , pgsql-sql@postgresql.org References: <20061003002049.GA1490@wolff.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/25 X-Sequence-Number: 26414 On Tue, Oct 03, 2006 at 14:43:40 +0300, Alexander Ilyin wrote: > > Thank you for your great idea. But how it can be used for positioning the cursor in the already existed ResultSet? Using your idea I can found the closest to targetvalue row but not its position in my ResultSet. You wouldn't be able to use it to position a cursor. But if you aren't retrieving a lot of records at once, this may still be a workable strategy for you. > Anyway thank you for your idea it is very useful by itself. Also I can solve my problem using your idea and emulating the movement in my existed ResultSet. Even better - no need to store the large RS between cursor movements. Just each time I need to fetch the all visible rows. That sounds pretty reasonable.