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 AD673D1B1AB for ; Tue, 13 Jul 2004 03:31:42 -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 44312-08 for ; Tue, 13 Jul 2004 06:31:40 +0000 (GMT) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id B2499D1B18E for ; Tue, 13 Jul 2004 03:31:31 -0300 (ADT) Received: from [192.168.0.40] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i6D6QVbP017563; Tue, 13 Jul 2004 14:26:31 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <40F3824C.8090607@familyhealth.com.au> Date: Tue, 13 Jul 2004 14:33:48 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Cheston Cc: pgsql-performance@postgresql.org Subject: Re: How to create an index for type timestamp column using References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed 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/71 X-Sequence-Number: 7462 > 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