Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 715F19FB367 for ; Tue, 22 May 2007 10:00:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 75419-02 for ; Tue, 22 May 2007 10:00:47 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.227]) by postgresql.org (Postfix) with ESMTP id 30B9E9FB293 for ; Tue, 22 May 2007 10:00:53 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id s1so2587331nze for ; Tue, 22 May 2007 06:00:51 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=NZJUuzSSddBtcYGMWbg3taQUDOHBZZ2NOR2isHlWhxDAHMHWeeGfFSGmtyLl36fUu5T5at9621UlEIcI7JtzM69V3969m19u23K4BDDxlOs7HodMYID5iVgTz7jlmr+R0V2SFy5EYndd8gB18khk6uwcaoXpFOblkEsSKvnyA4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=oJxIQYHqWGKa0JbVppRkcPj6sqaox1NY+3QDM+B8OMoBQDQHO1UtysccNRcJs3qwJH1Df1f9wUE0LAb+jetuFzsQqbBEMF4/ejwWOL1yLIQDMwz0fb3J/MtG361Rr5tOB0qgX0qTxT/HAeU4S76jPrWTEKSaTcIYo3KNs7eM/lY= Received: by 10.65.105.3 with SMTP id h3mr13211563qbm.1179838851455; Tue, 22 May 2007 06:00:51 -0700 (PDT) Received: by 10.65.177.7 with HTTP; Tue, 22 May 2007 06:00:51 -0700 (PDT) Message-ID: <88daf38c0705220600y7ec63ed7x7920576abf92ea32@mail.gmail.com> Date: Tue, 22 May 2007 15:00:51 +0200 From: "Alexander Staubo" To: pgsql-performance@postgresql.org Subject: Re: Performace comparison of indexes over timestamp fields In-Reply-To: <20070522124320.GA24779@uio.no> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4652C846.4020801@andromeiberica.com> <88daf38c0705220539q5807d2c2t1f20a03922bf8d33@mail.gmail.com> <20070522124320.GA24779@uio.no> X-Google-Sender-Auth: 3df387a469fea701 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/435 X-Sequence-Number: 24825 On 5/22/07, Steinar H. Gunderson wrote: > On Tue, May 22, 2007 at 02:39:33PM +0200, Alexander Staubo wrote: > > PostgreSQL uses B-tree indexes for scalar values. For an expression > > such as "t between a and b", I believe it's going to match both sides > > of the table independently (ie., t >= a and t <= b) and intersect > > these subsets. This is inefficient. > > A B-tree index can satisfy range queries such as this. You're right, and I'm wrong -- my head is not in the right place today. B-trees are inefficient for intervals, but quite satisfactory for range searches. Alexander.