Re: Endless loop in ExecNestLoop

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Endless loop in ExecNestLoop
Дата
Msg-id 4204.1138721998@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Endless loop in ExecNestLoop  (Philipp Reisner <philipp.reisner@linbit.com>)
Список pgsql-bugs
Philipp Reisner <philipp.reisner@linbit.com> writes:
> Well after more research it turned out that sometimes we have a plan
> that executes in less than 2 seconds, and somethimes we get a plan
> does not terminate within 1h30 of CPU time.

Could you send EXPLAIN ANALYZE output for this (at least for the fast
case)?  Presumably some of the planner's estimates are way off, but
there's no way to know which ones from just EXPLAIN.

>> What reasons are there for the planer to choose a different plan ?

It looks to me like the statistics have changed, because it's showing
different rowcount and width estimates for the same scan:

>                                        ->  Index Scan using contractelements_pkey on contractelements cel
(cost=0.00..5574.21rows=459 width=22) 
>                                              Filter: (upper((isactiv)::text) = 'Y'::text)

>                                        ->  Seq Scan on contractelements cel  (cost=0.00..4253.10 rows=387 width=21)
>                                              Filter: (upper((isactiv)::text) = 'Y'::text)

Perhaps you ran VACUUM or ANALYZE in between, or autovacuum did so for
you?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2225: Backend crash -- BIG table
Следующее
От: Philipp Reisner
Дата:
Сообщение: Fwd: Re: Endless loop in ExecNestLoop