[BUGS] Strange influence of default_statistics_target

Поиск
Список
Период
Сортировка
От Вадим Акбашев
Тема [BUGS] Strange influence of default_statistics_target
Дата
Msg-id CALoKji-qHPvXAL7omEoB0n2g5WudFDmqXf3tsMBUwYdtiiQRVA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [BUGS] Strange influence of default_statistics_target  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hello!
I have encountered a problem with querry plan building:
I'd set  default_statistics_target=700, run analyze. Postgres optimize had chosen plan with hash_join and it took ~1 min for qerry to complete.
Then i set default_statistics_target=500 and the plan was significantly changed and was using merge_join instead, complition time reduced in hundreds times, cost reduced drastically. 
Now i can't understand why more precise statistics leads to less optimized plan and what is the right way to use default_statistics_target parameter?
I attach both good and bad querry plans and the querry itself

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [BUGS] Bug in Physical Replication Slots (at least 9.5)?
Следующее
От: Joel Sanger
Дата:
Сообщение: [BUGS] BUG #14263: Query planner is slow to plan UPDATE on a table with many partitions