release-26.1: opt: apply min_row_count to anti-joins#164798
Merged
DrewKimball merged 1 commit intocockroachdb:release-26.1from Mar 4, 2026
Merged
release-26.1: opt: apply min_row_count to anti-joins#164798DrewKimball merged 1 commit intocockroachdb:release-26.1from
DrewKimball merged 1 commit intocockroachdb:release-26.1from
Conversation
|
Thanks for opening a backport. Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate. |
Member
Previously, the `optimizer_min_row_count` setting did not apply to the final selectivity calculated for AntiJoin expressions. This meant that the setting was applied asymmetrically, which could cause the optimizer to choose bad plans. This commit fixes the issue, gated behind a session setting `optimizer_use_min_row_count_anti_join_fix`. Fixes cockroachdb#162258 Release note (bug fix): Fixed a bug that prevented the optimizer_min_row_count setting from applying to anti-join expressions, which could lead to bad query plans. The fix is gated behind `optimizer_use_min_row_count_anti_join_fix`, and will be on by default on 26.2+, and off by default in prior versions.
a2737f4 to
5cd845c
Compare
mw5h
approved these changes
Mar 4, 2026
Contributor
mw5h
left a comment
There was a problem hiding this comment.
@mw5h made 1 comment.
Reviewable status:complete! 1 of 0 LGTMs obtained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport 1/4 commits from #163244.
/cc @cockroachdb/release
opt: apply min_row_count to anti-joins
Previously, the
optimizer_min_row_countsetting did not apply to thefinal selectivity calculated for AntiJoin expressions. This meant that
the setting was applied asymmetrically, which could cause the optimizer
to choose bad plans. This commit fixes the issue, gated behind a session
setting
optimizer_use_min_row_count_anti_join_fix.Fixes #162258
Release note (bug fix): Fixed a bug that prevented the optimizer_min_row_count
setting from applying to anti-join expressions, which could lead to bad query
plans. The fix is gated behind
optimizer_use_min_row_count_anti_join_fix, andwill be on by default on 26.2+, and off by default in prior versions.
Release justification: critical fix for optimizer regression in 25.4