-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: figure out how to handle subqueries by distSQLSpecExecFactory #51095
Copy link
Copy link
Open
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Description
- how do we handle subqueries?
This question comes from the fact that when we're serializing an expression of the main tree, it might be referencing the results of subqueries' evaluation, but we don't have those during execbuilding with current "single-path overmemotree" approach. I see two solutions:-
- perform some kind of lazy serialization for expressions (this would mean that physical plan tree that comes out from the builder would be incomplete) - this would allow us to keep the single traversal approach to building, but probably will come with other concerns
-
- change the builder to perform several traversals, in the first one we would build the subqueries, then we would probably execute them, and then we would run the second
memotraversal to build the remaining parts of the full plan given that we now have results of subqueries' evaluation. Not sure how hard and how breaking of a change this would be.
- change the builder to perform several traversals, in the first one we would build the subqueries, then we would probably execute them, and then we would run the second
-
- how do we connect appropriate
planNodes in the physical plan?
This question came up when I looked into implementingConstructBufferandConstructScanBuffer- it seems like we need to have some way of identifying aplanNodethat is wrapped into the physical plan so that we can instantiate anotherplanNode-to-be-wrapped, possibly in a different "tree" within the whole physical plan. This needs more investigation.
Jira issue: CRDB-4072
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Backlog