Re: Question about a query plan

Поиск
Список
Период
Сортировка
От Bill Moseley
Тема Re: Question about a query plan
Дата
Msg-id 20050916171819.GC17486@hank.org
обсуждение исходный текст
Ответ на Re: Question about a query plan  (Thomas O'Connell <tfo@sitening.com>)
Ответы Re: Question about a query plan  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
On Fri, Sep 16, 2005 at 10:02:28AM -0500, Thomas O'Connell wrote:
>
> On Sep 16, 2005, at 9:18 AM, Bill Moseley wrote:
>
> >First question is why the planner is not using an index scan when I
> >use "now()" or CURRENT_TIMESTAMP?
>
> It also used to be the case (pre-8.0; I couldn't find in the release
> notes whether this was an 8.0 or 8.1 fix) that now() and
> CURRENT_TIMESTAMP were not indexable, I think because of mutability.
>
> For older versions of postgres, it's recommended that you determine
> the time in the client and use constant data in your query.

Interesting.  I have a few VIEWs that include now(), but I guess I
could adjust and pass in the date from the client.

Thanks for the tip.

--
Bill Moseley
moseley@hank.org


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

Предыдущее
От: Bill Moseley
Дата:
Сообщение: Re: Question about a query plan
Следующее
От: Emi Lu
Дата:
Сообщение: Neither column can be NULL if the column is part of the combination of primary key columns?