Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type
Date
Msg-id 2550569.1737219097@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type  (Zhang Mingli <zmlpostgres@gmail.com>)
List 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 by date:

Previous
From: Zhang Mingli
Date:
Subject: Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type
Next
From: Jeff Janes
Date:
Subject: Re: BUG #18779: Segmentation fault while trying to connect via psql