* Chris Browne:

> The RangeType-based equivalent is the following:
>
> rangetest@localhost->  explain analyze select * from some_data where 
> '[2010-01-01,2010-02-01)'::daterange @> whensit;
>                                                QUERY PLAN
> ---------------------------------------------------------------------------------------------------------
>  Seq Scan on some_data  (cost=0.00..634.00 rows=1 width=8) (actual 
> time=1.045..111.739 rows=390 loops=1)
>    Filter: ('[ 2010-01-01, 2010-02-01 )'::daterange @> whensit)
>  Total runtime: 111.780 ms
> (3 rows)
>
> This, alas, reverts to a seq scan on the table, rather than restricting
> itself to the tuples of interest.

This is quite similar to LIKE and regexp matches.  The backend has a
kludge to use the index in such cases.  It did not seem extensible to
me last time I looked, unfortunately.

-- 
Florian Weimer                <fwei...@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to