| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера