Queries not always using index on timestamp search

Поиск
Список
Период
Сортировка
От Mike Nolan
Тема Queries not always using index on timestamp search
Дата
Msg-id 200406241459.i5OExwaI025590@gw.tssi.com
обсуждение исходный текст
Ответы Re: Queries not always using index on timestamp search  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Here are two queries (under 7.4.1):

'mytime' is a timestamp field that is indexed.

select * from mytable where mytime > '2004-06-21'

select * from mytable where mytime > current_date-3

Looking at an explain on these queries, the first one will use the
index and the second one will not, even though 'current_date-3'
produces the same date as the hard-coded one in the first search.

Is there a way to get the second query to use the index?
--
Mike Nolan

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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: unicode and sorting(at least)
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: 7.4.3 RPMS for RHEL3