Skip to content

opt: do not add derived FK equalities to lookup join ON filters#101873

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:101844-extra-on-conds
Apr 20, 2023
Merged

opt: do not add derived FK equalities to lookup join ON filters#101873
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:101844-extra-on-conds

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

This commit fixes a minor bug introduced in #90599 which can
unnecessarily add derived FK equality filters to a lookup join's ON
condition. The bug is minor because it does not cause incorrect results.
It only adds a bit of extra work to evaluate the equality. This commit
ensures that the derived FK filters are only used as equality columns in
the lookup join.

Fixes #101844

Release note: None

This commit fixes a minor bug introduced in cockroachdb#90599 which can
unnecessarily add derived FK equality filters to a lookup join's ON
condition. The bug is minor because it does not cause incorrect results.
It only adds a bit of extra work to evaluate the equality. This commit
ensures that the derived FK filters are only used as equality columns in
the lookup join.

Fixes cockroachdb#101844

Release note: None
@mgartner mgartner requested a review from msirek April 19, 2023 21:32
@mgartner mgartner requested a review from a team as a code owner April 19, 2023 21:32
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@mgartner mgartner added the backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only label Apr 19, 2023
Copy link
Copy Markdown
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!
:lgtm:

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

@mgartner
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 20, 2023

Build succeeded:

@craig craig bot merged commit c44424a into cockroachdb:master Apr 20, 2023
@mgartner mgartner deleted the 101844-extra-on-conds branch April 20, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opt: extra filters add to lookup join ON condition when derive FK equalities

3 participants