Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type
Дата
Msg-id 2550569.1737219097@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type  (Zhang Mingli <zmlpostgres@gmail.com>)
Список pgsql-bugs
Zhang Mingli <zmlpostgres@gmail.com> writes:
> And I have a question that may not be directly related to the issue: why is there a Subplan 2, and it appears to be
unused?

Yeah, that's because the AlternativeSubPlan originally had two child
subplans: a parameterized one intended for a few calls, and a hashed
one to be used for a lot of calls.  We build both because at the time
when this needs to happen, we don't have any clue how many calls
there will be.  We wait till the very end of planning to decide which
one is more likely to win based on context, and then discard the
AlternativeSubPlan, replacing it with a direct reference to the chosen
SubPlan.  But the other one stays in the tree.  Getting rid of it
seemed complicated, and it won't be referenced at runtime so there's
not much penalty from leaving it there.  It is confusing, I admit.

            regards, tom lane



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