Skip site navigation (1) Skip section navigation (2)

Re: Range Types - efficiency

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Chris Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types - efficiency
Date: 2011-02-10 10:03:25
Message-ID: 82vd0suryq.fsf@mid.bfk.de (view raw or flat)
Thread:
Lists: pgsql-hackers
* Chris Browne:

> The RangeType-based equivalent is the following:
>
> rangetest(at)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                <fweimer(at)bfk(dot)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

In response to

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2011-02-10 10:09:33
Subject: Re: SSI patch version 14
Previous:From: Itagaki TakahiroDate: 2011-02-10 09:56:15
Subject: Re: Add support for logging the current role

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group