Re: Index scan vs. Seq scan on timestamps

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Index scan vs. Seq scan on timestamps
Дата
Msg-id 20041207024925.GN10437@ns.snowman.net
обсуждение исходный текст
Ответ на Re: Index scan vs. Seq scan on timestamps  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Index scan vs. Seq scan on timestamps
Список pgsql-general
* Stephan Szabo (sszabo@megazone.bigpanda.com) wrote:
> On Mon, 6 Dec 2004, Per Jensen wrote:
> > select count(*)
> > from accesslog
> > where time  between (timeofday()::timestamp - INTERVAL '30 d') and
> > timeofday()::timestamp;
>
> Besides the type issue, timeofday() is volatile and thus is not allowed to
> be turned into a constant in order to do an index scan because it's
> allowed to return different values for every row of the input.

Is there a way to say "just take the value of this function at the start
of the transaction and then have it be constant" in a query?

    Stephen

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Index scan vs. Seq scan on timestamps
Следующее
От: Andrew - Supernews
Дата:
Сообщение: Re: Index scan vs. Seq scan on timestamps