Re: What is the difference between these?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What is the difference between these?
Дата
Msg-id 11491.1099686748@sss.pgh.pa.us
обсуждение исходный текст
Ответ на What is the difference between these?  (Matt Nuzum <matt.followers@gmail.com>)
Список pgsql-performance
Matt Nuzum <matt.followers@gmail.com> writes:
> To me, these three queries seem identical... why doesn't the first one
> (simplest to understand and write) go the same speed as the third one?

This is the standard problem that the planner has to guess about the
selectivity of inequalities involving non-constants (like now()).
The guesses are set up so that a one-sided inequality will use a
seqscan while a range constraint will use an indexscan.

See the pgsql-performance archives for other ways of persuading it
that an indexscan is a good idea.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strange (?) Index behavior?
Следующее
От: Allen Landsidel
Дата:
Сообщение: Re: Strange (?) Index behavior?