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

Re: Timestamp-based indexing

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Litao Wu <litaowu(at)yahoo(dot)com>,"Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>,"Harmon S(dot) Nine" <hnine(at)netarx(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Timestamp-based indexing
Date: 2004-07-27 01:53:01
Message-ID: 4105B57D.3040003@familyhealth.com.au (view raw or flat)
Thread:
Lists: pgsql-performance
>>It seems to me that Postgres will treat it as
>>a constant.
> 
> 
> Yeah, that works too, though again it might burn you if used inside a
> function or prepared statement.  What you're doing here is to push the
> freezing of the "now" value even further upstream, namely to initial
> parsing of the command.

What I do in my apps to get postgres to use the timestamp indexes in 
some situations is to just generate the current timestamp in iso format 
and then just insert it into the query as a constant, for that run of 
the query.

Chris


In response to

pgsql-performance by date

Next:From: Greg StarkDate: 2004-07-27 04:32:37
Subject: Re: arrays and indexes
Previous:From: Tom LaneDate: 2004-07-26 21:40:07
Subject: Re: Timestamp-based indexing

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