Re: Optimizer not using index when it should

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Optimizer not using index when it should
Дата
Msg-id 1051621449.76105.9.camel@jester
обсуждение исходный текст
Ответ на Optimizer not using index when it should  (Rob Messer <rrmesser@yahoo.com>)
Ответы Re: Optimizer not using index when it should  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
> What can I do to fix this -- is there something I am missing about
> setting statistics or some configuration variable I can change?  Any
> insights would be greatly appreciated.  Thank you,

If you look at the estimates for cost, the index scan is more expensive
by ~1/8th. But as you've shown, it's not.

You might try adjusting the random_page_cost down to something more
appropriate for your hardware and situation.

Do testing... this may cause other queries to use an index scan when
they should have been doing a sequential scan.  Mistakenly using an
index can be a much more costly error (hence the high default
random_page_cost).

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Вложения

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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: profiling plpgsql functions..
Следующее
От: "SZŰCS Gábor"
Дата:
Сообщение: Query Plan far worse in 7.3.2 than 7.2.1