Re: Seq Scan

Поиск
Список
Период
Сортировка
От Reece Hart
Тема Re: Seq Scan
Дата
Msg-id 1180720246.4821.47.camel@snafu.site
обсуждение исходный текст
Ответ на Re: Seq Scan  ("Tyler Durden" <tylersticky@gmail.com>)
Список pgsql-general
On Fri, 2007-06-01 at 18:24 +0100, Tyler Durden wrote:
It uses Index Scan for id>200000 and Seq Scan for id>10?!

Based on the statistics pg has for your table, and on the cost of using the index, the cost based optimizer decided that it's more efficient to seq scan all of the rows than to incur the index overhead. These decisions are not always correct, but they're usually quite good.

If you don't believe it, try:
# set enable_seqscan=off;
# explain analyze ...
# set enable_seqscan=on;
# explain analyze ...

-Reece

-- 
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0

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

Предыдущее
От: RW
Дата:
Сообщение: Re: Restoring 8.2 to 8.0
Следующее
От: Mike Ginsburg
Дата:
Сообщение: Re: Interval Rounding