Skip to content

Conversation

@blathers-crl
Copy link

@blathers-crl blathers-crl bot commented Nov 4, 2025

Backport 1/1 commits from #156879 on behalf of @mgartner.


This commit extends #155163. Instead of tracking an auxiliary boolean
value to indicate that a plan has one or more expressions with unbounded
cardinality, the memo.Cost struct now tracks the number of read
expressions (i.e., expressions that perform KV reads) that have
unbounded cardinality. This helps to avoid picking generic query plans
that will perform significantly worse than their related custom query
plans.

Fixes #156690

Release note: None


Release justification: Low-risk generic query plan improvement.

This commit extends #155163. Instead of tracking an auxiliary boolean
value to indicate that a plan has one or more expressions with unbounded
cardinality, the `memo.Cost` struct now tracks the number of read
expressions (i.e., expressions that perform KV reads) that have
unbounded cardinality. This helps to avoid picking generic query plans
that will perform significantly worse than their related custom query
plans.

Fixes #156690

Release note: None
@blathers-crl blathers-crl bot requested a review from a team as a code owner November 4, 2025 23:54
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-25.4-156879 branch from c2c3d55 to fcb6e84 Compare November 4, 2025 23:54
@blathers-crl blathers-crl bot requested review from mgartner and removed request for a team November 4, 2025 23:54
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Nov 4, 2025
@blathers-crl blathers-crl bot requested review from DrewKimball and michae2 November 4, 2025 23:54
@blathers-crl
Copy link
Author

blathers-crl bot commented Nov 4, 2025

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.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-sql-queries SQL Queries Team labels Nov 4, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

:lgtm:

@michae2 reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball and @mgartner)

@mgartner mgartner merged commit bb30bec into release-25.4 Nov 5, 2025
24 of 25 checks passed
@mgartner mgartner deleted the blathers/backport-release-25.4-156879 branch November 5, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-queries SQL Queries Team target-release-25.4.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants