Re: BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zhang Mingli <zmlpostgres@gmail.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-01-18T16:51:37Z
Lists: 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
Commits
-
Fix setrefs.c's failure to do expression processing on prune steps.
- bf826ea06297 18.0 landed
- 94c02bd3345d 16.7 landed
- 724ebebb1104 15.11 landed
- 5f725648fa3b 14.16 landed
- 45004f527afa 13.19 landed
- 0671a71e0210 17.3 landed