Re: Expected accuracy of planner statistics

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Expected accuracy of planner statistics
Дата
Msg-id 20060929010011.GQ34238@nasby.net
обсуждение исходный текст
Ответ на Expected accuracy of planner statistics  (Casey Duncan <casey@pandora.com>)
Список pgsql-general
On Thu, Sep 28, 2006 at 03:19:46PM -0700, Casey Duncan wrote:
> I have some databases that have grown significantly over time (as
> databases do). As the databases have grown, I have noticed that the
> statistics have grown less and less accurate. In particular, the
> n_distinct values have become many OOM too small for certain foreign
> key columns. Predictably this leads to poor query plans.

Search the -hackers archives. The problem is that you can't actually get
a good n_distinct estimate if you're sampling less than a very large
chunk of the table. Since our sampling maxes out at something like 30k
pages, at some point the n_distinct estimates just degrade. :(

Patches/solutions welcome. :)
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

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

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Can i see server SQL commands ?
Следующее
От: "Adnan DURSUN"
Дата:
Сообщение: Re: Can i see server SQL commands ?