Re: Why does it not use the index?

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Why does it not use the index?
Дата
Msg-id m3n0f7aedd.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Why does it not use the index?  (Philip Greer <philip@tildesoftware.com>)
Список pgsql-general
Philip Greer <philip@tildesoftware.com> writes:

> WTF? Why would a vacuum be necessary in order for it to start using the index?

It's not the VACUUM that's necessary; it's the ANALYZE.  The query
planner uses table statistics to make its decisions, and ANALYZE is
what collects those statistics.  Without an ANALYZE the planner will
make default assumptions that are rarely correct.  :)

VACUUM should also be run regularly, of course.

-Doug

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Why does it not use the index?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Why does it not use the index?