Re: Performace comparison of indexes over timestamp fields

From: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performace comparison of indexes over timestamp fields
Date: 2007-05-22 12:43:20
Message-ID: 20070522124320.GA24779@uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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 should get better performance by mapping timestamps to a
> one-dimensional plane and indexing them using GiST. GiST implements an
> R-tree-like structure that supports bounding-box searches.

You may be thinking of interval overlaps?

/* Steinar */
--
Homepage: http://www.sesse.net/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexander Staubo 2007-05-22 13:00:51 Re: Performace comparison of indexes over timestamp fields
Previous Message Alexander Staubo 2007-05-22 12:39:33 Re: Performace comparison of indexes over timestamp fields