Re: Timestamp-based indexing

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Timestamp-based indexing
Дата
Msg-id 4105B57D.3040003@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Timestamp-based indexing  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Timestamp-based indexing
Следующее
От: Greg Stark
Дата:
Сообщение: Re: arrays and indexes