Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 7C1429FA2E9 for ; Wed, 1 Nov 2006 01:27:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 35901-02 for ; Wed, 1 Nov 2006 05:26:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exprod6og50.obsmtp.com (exprod6og50.obsmtp.com [64.18.1.181]) by postgresql.org (Postfix) with SMTP id 21BFB9FA085 for ; Wed, 1 Nov 2006 01:26:17 -0400 (AST) Received: from source ([63.240.6.47]) by exprod6ob50.postini.com ([64.18.5.12]) with SMTP; Tue, 31 Oct 2006 21:26:13 PST Received: from 172.16.1.25 by mail.Mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D1)); Wed, 01 Nov 2006 00:26:06 -0500 X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by D01HOST03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 1 Nov 2006 00:26:06 -0500 Received: from 69.181.100.71 ([69.181.100.71]) by MI8NYCMAIL06.Mi8.com ( [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( [172.16.1.105]) with Microsoft Exchange Server HTTP-DAV ; Wed, 1 Nov 2006 05:26:06 +0000 User-Agent: Microsoft-Entourage/11.2.5.060620 Date: Tue, 31 Oct 2006 21:26:04 -0800 Subject: Re: Help w/speeding up range queries? From: "Luke Lonergan" To: "Tom Lane" , "John Major" cc: pgsql-performance@postgresql.org Message-ID: Thread-Topic: [PERFORM] Help w/speeding up range queries? Thread-Index: Acb9djmKeAc/72lpEduBWQAWy4o9DA== In-Reply-To: <12189.1162355349@sss.pgh.pa.us> MIME-Version: 1.0 X-OriginalArrivalTime: 01 Nov 2006 05:26:06.0807 (UTC) FILETIME=[3B370E70:01C6FD76] X-WSS-ID: 6956F0642PS1117194-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/2 X-Sequence-Number: 21772 John, On 10/31/06 8:29 PM, "Tom Lane" wrote: >> 'chrX' and StartPosition > 1000500 and EndPosition < 2000000; > > Also, there's the PostGIS stuff, though it might be overkill for what > you want. Oops - I missed the point earlier. Start and End are separate attributes so this is like an unbounded window in a Start,End space. PostGis provides quadtree indexing would provide a terse TID list but you still have the problem of how to ensure that the heap tuples being scanned are efficiently retrieved, which would only happen if they are grouped similarly to the retrieval pattern, right? - Luke