Skip to content

release-26.2: sql: show table stats rollout mode in EXPLAIN and EXPLAIN ANALYZE#166129

Merged
ZhouXing19 merged 1 commit intorelease-26.2from
blathers/backport-release-26.2-165981
Mar 20, 2026
Merged

release-26.2: sql: show table stats rollout mode in EXPLAIN and EXPLAIN ANALYZE#166129
ZhouXing19 merged 1 commit intorelease-26.2from
blathers/backport-release-26.2-165981

Conversation

@blathers-crl
Copy link

@blathers-crl blathers-crl bot commented Mar 19, 2026

Backport 1/1 commits from #165981 on behalf of @ZhouXing19.


When the canary stats experiment is active (sql.stats.canary_fraction > 0),
EXPLAIN and EXPLAIN ANALYZE now emit a "table stats mode" field indicating
whether the plan was built using "canary" (newest) or "stable"
(second-newest) table statistics. The field is omitted when the
experiment is off (i.e. sql.stats.canary_fraction == 0).

Individual scan nodes also show the table's canary window duration
(canary window: <duration>) when the table has divergent canary vs.
stable statistics. This is a table-level property indicating the table
participates in the experiment; the query-level table stats mode
field indicates which stats path was actually used.

Part of: #156817

Release note (sql change): EXPLAIN and EXPLAIN ANALYZE now display
a "table stats mode" field ("canary" or "stable") when the canary
statistics rollout experiment is active, indicating which table
statistics were used for query planning. Scan nodes for tables with
active canary stats also show the configured canary window duration.

Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com


Release justification: important observability part of a feature that is asked by the customer.

When the canary stats experiment is active (sql.stats.canary_fraction > 0),
EXPLAIN and EXPLAIN ANALYZE now emit a "table stats mode" field indicating
whether the plan was built using "canary" (newest) or "stable"
(second-newest) table statistics. The field is omitted when the
experiment is off.

Individual scan nodes also show the table's canary window duration
("canary window: <duration>") when the table has divergent canary vs.
stable statistics. This is a table-level property indicating the table
participates in the experiment; the query-level "table stats mode"
field indicates which stats path was actually used.

Part of: #156817

Release note (sql change): EXPLAIN and EXPLAIN ANALYZE now display
a "table stats mode" field ("canary" or "stable") when the canary
statistics rollout experiment is active, indicating which table
statistics were used for query planning. Scan nodes for tables with
active canary stats also show the configured canary window duration.

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@blathers-crl blathers-crl bot requested a review from a team as a code owner March 19, 2026 02:52
@blathers-crl blathers-crl bot requested review from mw5h and removed request for a team March 19, 2026 02:52
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Mar 19, 2026
@blathers-crl
Copy link
Author

blathers-crl bot commented Mar 19, 2026

⚠️ End-of-Life Version Warning

This backport targets 26.2, which is an End-of-Life (EOL) version.

Please verify that backporting to this EOL version is intentional and appropriate. EOL versions no longer receive maintenance updates according to our support policy.


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 Mar 19, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@mw5h mw5h left a comment

Choose a reason for hiding this comment

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

:lgtm:

@mw5h reviewed 13 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on michae2, yuzefovich, and ZhouXing19).

@ZhouXing19 ZhouXing19 merged commit 6e1e2f7 into release-26.2 Mar 20, 2026
22 checks passed
@ZhouXing19 ZhouXing19 deleted the blathers/backport-release-26.2-165981 branch March 20, 2026 01:35
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-26.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants