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: add session setting for join elimination optimization #107319

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

DrewKimball
Copy link
Collaborator

We recently added support for column remapping in the join elimination rules that allows columns from the eliminated input of the join to be mapped to equivalent columns from the preserved input. This allows joins to be eliminated in more cases - in particular, the self-join patterns that can arise from an UPDATE ... FROM statement where the table in the FROM clause is the same as the table being updated.

This patch adds a setting, optimizer_use_improved_join_elimination, which gates the column-remapping logic for the join-elimination rules. The plan is to backport the column-remapping changes to 23.1 behind this setting turned off by default.

Informs #102614

Release note: None

We recently added support for column remapping in the join elimination
rules that allows columns from the eliminated input of the join to be
mapped to equivalent columns from the preserved input. This allows
joins to be eliminated in more cases - in particular, the self-join
patterns that can arise from an `UPDATE ... FROM` statement where the
table in the `FROM` clause is the same as the table being updated.

This patch adds a setting, `optimizer_use_improved_join_elimination`,
which gates the column-remapping logic for the join-elimination rules.
The plan is to backport the column-remapping changes to 23.1 behind
this setting turned off by default.

Informs cockroachdb#102614

Release note: None
@DrewKimball DrewKimball requested a review from a team as a code owner July 20, 2023 22:33
@DrewKimball DrewKimball requested a review from rytaft July 20, 2023 22:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 14 of 14 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rytaft)

@DrewKimball
Copy link
Collaborator Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 21, 2023

Build succeeded:

@craig craig bot merged commit 8d10f15 into cockroachdb:master Jul 21, 2023
@DrewKimball DrewKimball deleted the eliminate-join-setting branch July 22, 2023 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants