Re: EXPLAIN ANALYZE not considering primary and unique indices!

Поиск
Список
Период
Сортировка
От Alan Hodgson
Тема Re: EXPLAIN ANALYZE not considering primary and unique indices!
Дата
Msg-id 200708271144.18213@hal.medialogik.com
обсуждение исходный текст
Ответ на EXPLAIN ANALYZE not considering primary and unique indices!  (Sanjay <skpatel20@gmail.com>)
Список pgsql-general
On Monday 27 August 2007 05:21, Sanjay <skpatel20@gmail.com> wrote:
>Wondering why it is not using the index, which would have
> been
> automatically created for the primary key.

Because you not only have just one row in the whole table, 100% of them will
match the query. In short, one page fetch for a seq scan is faster than
first looking it up in an index and then fetching the same page.

set enable_seqscan=false;


--
"Government big enough to supply everything you need is big enough to take
everything you have ... the course of history shows that as a government
grows, liberty decreases." -- Thomas Jefferson


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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: EXPLAIN ANALYZE not considering primary and unique indices!
Следующее
От: Decibel!
Дата:
Сообщение: Re: [HACKERS] Undetected corruption of table files