Re: Query plan changes after pg_dump / pg_restore
От | Tom Lane |
---|---|
Тема | Re: Query plan changes after pg_dump / pg_restore |
Дата | |
Msg-id | 11770.1118328898@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Query plan changes after pg_dump / pg_restore (Jona <jonanews@oismail.com>) |
Ответы |
Re: Query plan changes after pg_dump / pg_restore
|
Список | pgsql-performance |
Jona <jonanews@oismail.com> writes: > What worries me is that the plan is different, Given that the estimated costs are close to the same, this is probably just the result of small differences in the ANALYZE statistics leading to small differences in cost estimates and thus choice of different plans. I'll bet if you re-ANALYZE a few times on the source database you'll see it flipping between plan choices too. This is normal because ANALYZE takes a random sample of rows rather than being exhaustive. So the interesting question is not "why are the plan choices different" it is "how do I get the cost estimates closer to reality". That's the only way in the long run to ensure the planner makes the right choice. Increasing the statistics targets or fooling with planner cost parameters are the basic tools you have available here. regards, tom lane
В списке pgsql-performance по дате отправления: