Re: Odd planner choice?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Odd planner choice?
Дата
Msg-id 15493.1097265882@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Odd planner choice?  ("Gary Doades" <gpd@gpdnet.co.uk>)
Ответы Re: Odd planner choice?
Список pgsql-performance
"Gary Doades" <gpd@gpdnet.co.uk> writes:
> If I remove the redundant clauses, the planner now estimates 1000 rows returned from
> the table, not unreasonable since it has no statistics. But *why* in that case, with *more*
> estimated rows does it choose to materialize that table (26 rows) 573416 times!!!

It isn't.  It's materializing that once and scanning it 573416 times,
once for each row in the outer relation.  And this is not a bad plan
given the estimates.  If it had stuck to what you call the good plan,
and there *had* been 1000 rows in the temp table, that plan would have
run 1000 times longer than it did.

As a general rule, if your complaint is that you get a bad plan for an
unanalyzed table, the response is going to be "so analyze the table".

            regards, tom lane

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

Предыдущее
От: "Gary Doades"
Дата:
Сообщение: Re: Odd planner choice?
Следующее
От: "Gary Doades"
Дата:
Сообщение: Re: Odd planner choice?