Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: figure out how to handle subqueries by distSQLSpecExecFactory #51095

Open
2 tasks
yuzefovich opened this issue Jul 7, 2020 · 1 comment
Open
2 tasks
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team
Projects

Comments

@yuzefovich
Copy link
Member

yuzefovich commented Jul 7, 2020

  • 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 over memo tree" approach. I see two solutions:
      1. 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
      1. 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 memo traversal 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.
  • how do we connect appropriate planNodes in the physical plan?
    This question came up when I looked into implementing ConstructBuffer and ConstructScanBuffer - it seems like we need to have some way of identifying a planNode that is wrapped into the physical plan so that we can instantiate another planNode-to-be-wrapped, possibly in a different "tree" within the whole physical plan. This needs more investigation.

Jira issue: CRDB-4072

@yuzefovich yuzefovich self-assigned this Jul 7, 2020
@yuzefovich yuzefovich added this to Triage in BACKLOG, NO NEW ISSUES: SQL Execution via automation Jul 7, 2020
@yuzefovich yuzefovich moved this from Triage to 20.2 D in BACKLOG, NO NEW ISSUES: SQL Execution Jul 7, 2020
@cockroachdb cockroachdb deleted a comment from blathers-crl bot Jul 7, 2020
@asubiotto asubiotto moved this from 20.2 D to [GENERAL BACKLOG] Enhancements/Features/Investigations in BACKLOG, NO NEW ISSUES: SQL Execution Aug 4, 2020
@asubiotto asubiotto moved this from [GENERAL BACKLOG] Enhancements/Features/Investigations to 21.1 Possible Issues in BACKLOG, NO NEW ISSUES: SQL Execution Sep 3, 2020
@asubiotto asubiotto moved this from 21.1 Possible Issues to [GENERAL BACKLOG] Enhancements/Features/Investigations in BACKLOG, NO NEW ISSUES: SQL Execution Sep 30, 2020
@yuzefovich yuzefovich added this to Triage in SQL Queries via automation Apr 28, 2021
@yuzefovich yuzefovich removed this from [GENERAL BACKLOG] Enhancements/Features/Investigations in BACKLOG, NO NEW ISSUES: SQL Execution Apr 28, 2021
@yuzefovich yuzefovich moved this from Triage to 21.2 in SQL Queries Apr 28, 2021
@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@yuzefovich yuzefovich moved this from 21.2 High Likelihood (90%) to 21.2 Low Likelihood (10%) in SQL Queries Jul 20, 2021
@yuzefovich yuzefovich moved this from 22.1 Low Likelihood (10%) to 22.2 Low Likelihood (10%) in SQL Queries Apr 27, 2022
@rytaft rytaft moved this from 22.2 Low Likelihood (10%) to 22.2 Release in SQL Queries May 25, 2022
@yuzefovich yuzefovich removed their assignment May 31, 2022
@mgartner mgartner moved this from 22.2 Release to Backlog in SQL Queries Jul 7, 2022
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@yuzefovich yuzefovich added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) and removed no-issue-activity labels Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-queries SQL Queries Team
Projects
Status: Backlog
SQL Queries
Backlog (DO NOT ADD NEW ISSUES)
Development

No branches or pull requests

2 participants