Re: Index usage for tstzrange? - Mailing list pgsql-performance

From Heikki Linnakangas
Subject Re: Index usage for tstzrange?
Date
Msg-id 514CE0DA.5040109@vmware.com
Whole thread Raw
In response to Re: Index usage for tstzrange?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Index usage for tstzrange?
Re: Index usage for tstzrange?
List pgsql-performance
On 22.03.2013 02:05, Josh Berkus wrote:
>> Well, no.<@ is not a btree-indexable operator.
>
> Yes, but it's equivalent to ( ( a>= b1 or b1 is null ) and ( a<  b2 or
> b2 is null ) ), which *is* btree-indexable and can use an index.  So it
> seems like the kind of optimization we could eventually make.

Yeah. The sort order of <@ is the same as regular b-tree, so it should
be possible. In fact, nothing stops you from creating the suitable
operator and b-tree support functions. See attached patch for int4, but
the same should work for timestamptz.

We should do this automatically. Or am I missing something?

- Heikki

Attachment

pgsql-performance by date:

Previous
From: Cindy Makarowsky
Date:
Subject: Re: Performance of query
Next
From: Josh Berkus
Date:
Subject: Re: Index usage for tstzrange?