Re: Timestamp indexes (why ">" or "between" does not use index?)

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Timestamp indexes (why ">" or "between" does not use index?)
Дата
Msg-id AFCE3873-698E-48D2-A721-0EC219A2E2D2@seespotcode.net
обсуждение исходный текст
Ответ на Timestamp indexes (why ">" or "between" does not use index?)  ("Phoenix Kiula" <phoenix.kiula@gmail.com>)
Ответы Re: Timestamp indexes (why ">" or "between" does not use index?)
Список pgsql-general
On Feb 16, 2008, at 9:42 , Phoenix Kiula wrote:

> The EXPLAIN tells me it needs to do a seq
> scan. Why is this? How can I make a date/time field index which uses
> both equality criteria and the greater than/lesser than/between
> criteria?
>


The planner will choose a seq scan if it thinks that it will be
faster than using an index: if based on its statistics it thinks a
large portion of rows will match the criteria, a seq scan may well be
faster than an index scan.

Have you analyzed recently? Showing us the EXPLAIN ANALYZE for your
query would be helpful. Have you tried running the EXPLAIN ANALYZE
with seq scans disabled?

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: Re: Timestamp indexes (why ">" or "between" does not use index?)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Timestamp indexes (why ">" or "between" does not use index?)