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 C516DD1B1B0 for ; Tue, 13 Jul 2004 04:56:07 -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 79534-03 for ; Tue, 13 Jul 2004 07:56:06 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by svr1.postgresql.org (Postfix) with SMTP id DD82DD1B18E for ; Tue, 13 Jul 2004 04:55:55 -0300 (ADT) Received: by mproxy.gmail.com with SMTP id 72so17986rnf for ; Tue, 13 Jul 2004 00:56:03 -0700 (PDT) Received: by 10.38.163.20 with SMTP id l20mr350761rne; Tue, 13 Jul 2004 00:56:02 -0700 (PDT) Message-ID: Date: Tue, 13 Jul 2004 00:56:02 -0700 From: Chris Cheston To: pgsql-performance@postgresql.org Subject: Re: How to create an index for type timestamp column using rtree? In-Reply-To: <40F3824C.8090607@familyhealth.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <40F3824C.8090607@familyhealth.com.au> 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/72 X-Sequence-Number: 7463 Thanks, Chris and Tom. I had read *incorrectly* that rtrees are better for <= and >= comparisons. Chris On Tue, 13 Jul 2004 14:33:48 +0800, Christopher Kings-Lynne wrote: > > I'm storing some timestamps as integers (UTF) in a table and I want to > > query by <= and >= for times between a certain period. The table has > > gotten quite large and is now very slow in querying. > > > > I think it's time to create an index for the timestamp column. > > Uh, yeah. > > > I tried using an rtree (for <= and >= optimization): > > Bad idea. > > > Do I have to create an rtree type for my timestamp integer column? > > Why do you want an rtree index? They're for multidimensional polygonal > data and stuff. Just create a normal index... > > Chris > >