Re: Index scan vs. Seq scan on timestamps

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: Index scan vs. Seq scan on timestamps
Дата
Msg-id slrncr9isp.sjo.andrew+nonews@trinity.supernews.net
обсуждение исходный текст
Ответ на Index scan vs. Seq scan on timestamps  (Per Jensen <per@net-es.dk>)
Ответы Re: Index scan vs. Seq scan on timestamps
Список pgsql-general
On 2004-12-06, Per Jensen <per@net-es.dk> wrote:
> Why does PG not use the index on the time column in the second select,
> timeofday() has been cast to a timestamp after all.

"timestamp" is "timestamp without time zone" (not the most useful type in
the world). Your column is of type "timestamp with time zone" (correct).
The relationship between the two is not trivial and the lack of an index
scan therefore expected. Try casting to "timestamp with time zone" instead.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: select single entry and its neighbours using direct-acess to index?
Следующее
От: Eric E
Дата:
Сообщение: Re: Auditing with shared username