On 30/10/2023 09:24, Richard Guo wrote: > I also have some concerns about this patch. It requires that > root->parse remains unchanged during the whole subquery_planner() in > order to work, which is an implicit constraint we did not have before.
It is not about unchanged; it is about referencing the same query at the parent and child query blocks. Am I missing something?
Yeah, that's what I meant. We need to ensure that root->parse references the same Query structure during the whole subquery_planner() for this patch to work, which seems hacky, and error-prone for future development. If we really want to do so, at least we need to emphasize this point in the comment of subquery_planner().