Re: Timestamp-based indexing - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: Timestamp-based indexing
Date
Msg-id 4105B57D.3040003@familyhealth.com.au
Whole thread Raw
In response to Re: Timestamp-based indexing  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Timestamp-based indexing
Next
From: Greg Stark
Date:
Subject: Re: arrays and indexes