Re: Index on timestamp field, and now()

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Index on timestamp field, and now()
Дата
Msg-id 3C67E880.73065EB0@fourpalms.org
обсуждение исходный текст
Ответ на Index on timestamp field, and now()  (Denis Perchine <dyp@perchine.com>)
Ответы Re: Index on timestamp field, and now()
Список pgsql-general
> I have quite interesting problem. I have a table with a timestamp field.
> I have an index on it. When I use constant date in where clause, PostgreSQL
> uses index. But when I try to use now() there, it uses a sequence scan.
> As far as I can understand in inside any query now() is a constant.
> What is the problem here.

You did not specify what version of PostgreSQL you are running, but it
may be that now() is returning abstime, not timestamp.

Use the constant "timestamp 'now'" instead; seems to work for me in
PgSQL 7.1.

                    - Thomas

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: [HACKERS] Feature enhancement request : use of libgda in
Следующее
От: Denis Perchine
Дата:
Сообщение: Re: Index on timestamp field, and now()