Re: Help on indexing timestamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andre Schubert <andre(at)km3(dot)de>
Cc: achill(at)matrix(dot)gatewaynet(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Help on indexing timestamps
Date: 2003-03-10 15:07:32
Message-ID: 17309.1047308852@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andre Schubert <andre(at)km3(dot)de> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Update to 7.3, and that problem will go away.
>>
> What is the difference between 7.2 and 7.3 related to my problem ?

7.3 is willing to index comparisons to now(), that's what ;-)

You may care to study the difference between cachable/noncachable
functions in 7.2, versus the difference between
immutable/stable/volatile functions in 7.3. 7.2 has to treat now()
as noncachable and therefore unsafe to index. 7.3 treats it as
stable and therefore safe to index.

You can work around this in 7.2 by cheating with subselects or wrapper
functions, but that's a poor substitute for a real solution.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-03-10 15:14:27 Re: Optimizing view
Previous Message Tom Lane 2003-03-10 14:40:55 Re: Cursors and backwards scans and SCROLL