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

opt: simplify outer joins in more cases #83962

Open
DrewKimball opened this issue Jul 7, 2022 · 1 comment
Open

opt: simplify outer joins in more cases #83962

DrewKimball opened this issue Jul 7, 2022 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team

Comments

@DrewKimball
Copy link
Collaborator

DrewKimball commented Jul 7, 2022

Describe the problem

Currently, we don't fire null-rejection rules when the query has outer columns. This is to avoid cases where IS NOT NULL filter pushdown rules conflict with decorrelation rules that attempt to pull the filters back up the tree (see #35171).

To Reproduce

The left join in #80901 could not be simplified for the above reason.

Expected behavior

One possibility is to change the way null-rejection rules work; instead of creating an IS NOT NULL filter and relying on filter pushdown rules to ensure it reaches the operator that requested null-rejection, we could traverse the query tree wherever it would be possible to push down an IS NOT NULL filter and simplify outer joins as we go. This would prevent conflicts with decorrelation rules because the simplification would take place 'all at once', without invoking normalization during the traversal.

Jira issue: CRDB-17371

@DrewKimball DrewKimball added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jul 7, 2022
@DrewKimball DrewKimball self-assigned this Jul 7, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Jul 7, 2022
@mgartner mgartner moved this to Backlog (DO NOT ADD NEW ISSUES) in SQL Queries Jul 24, 2023
Copy link

github-actions bot commented Jan 1, 2024

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!

@DrewKimball DrewKimball moved this from Backlog (DO NOT ADD NEW ISSUES) to New Backlog in SQL Queries Jan 2, 2024
@DrewKimball DrewKimball removed their assignment Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team
Projects
Status: Backlog
Development

No branches or pull requests

1 participant