Bad Plan for Questionnaire-Type Query

Поиск
Список
Период
Сортировка
От David Blewett
Тема Bad Plan for Questionnaire-Type Query
Дата
Msg-id 9d1f8d830905070953v128e76e8q783b8b4caec78217@mail.gmail.com
обсуждение исходный текст
Ответы Re: Bad Plan for Questionnaire-Type Query
Список pgsql-performance
I have a query [1] that Postgres is insisting on using a Nested Loop
for some reason when a Hash Join is much faster. It seems like the
estimates are way off. I've set default_statistics_target to 250, 500,
1000 and analyzed, but they never seem to improve. If I disable
nestloops, the query completes in around 3-5s. With them enabled, it
takes anywhere from 45 to 60 seconds. Here is the DDL for the tables
and the month_last_day function [4].

Any help would be appreciated!

David Blewett

1. http://dpaste.com/hold/41842/
2. http://explain.depesz.com/s/Wg
3. http://explain.depesz.com/s/1s
4. http://dpaste.com/hold/41846/

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

Предыдущее
От: Nikolas Everett
Дата:
Сообщение: Re: Slow select performance despite seemingly reasonable query plan
Следующее
От: David Blewett
Дата:
Сообщение: Re: Bad Plan for Questionnaire-Type Query