Re: index not being used. Why?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: index not being used. Why?
Дата
Msg-id 45F18474.4000207@archonet.com
обсуждение исходный текст
Ответ на index not being used. Why?  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Список pgsql-sql
Gerardo Herzig wrote:
>         ->  Seq Scan on pages  (cost=0.00..9.08 rows=408 width=55)

> Watch the last row of the explain command. It makes a sequential scan on 
> the pages table, like it is not using the index on the "id" field.

You only have 408 rows in the table - it's probably not worth the 
trouble of using an index and *then* fetching the rows. Especially since  it's going to match most of the pages
anyway.

Try adding a few thousand rows, analyse and see if it decides to use the 
index then.
--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: [Re: PRIMARY KEY]
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: index not being used. Why?