Index usage for tstzrange?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Index usage for tstzrange?
Date: 2013-03-21 00:12:56
Message-ID: 514A5088.6060101@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Folks,

I just noticed that if I use a tstzrange for convenience, a standard
btree index on a timestamp won't get used for it. Example:

table a (
id int,
val text,
ts timestamptz
);
index a_ts on a(ts);

SELECT * FROM a WHERE ts <@ tstzrange('2013-01-01','2013-01-01 00:10:00')

... will NOT use the index a_ts. Is this something which could be fixed
for 9.4?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message David Rees 2013-03-21 00:44:36 Re: New server setup
Previous Message Rodrigo Barboza 2013-03-18 18:54:12 Re: effective_cache_size on 32-bits postgres