information-schema: note the extra cost of querying TABLE/PARTITION size columns - #23685
information-schema: note the extra cost of querying TABLE/PARTITION size columns#23685mjonss wants to merge 1 commit into
Conversation
…ize columns Add a note to the TABLES and PARTITIONS pages explaining that AVG_ROW_LENGTH, DATA_LENGTH, and INDEX_LENGTH read per-column size statistics from mysql.stats_histograms and cost more than querying only TABLE_ROWS, which reads only mysql.stats_meta. Documents the behavior from pingcap/tidb#69818. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughChangesInformation Schema Documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized documentation-only change adds guidance about the cost of querying size columns; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note: if pingcap/tidb#70742 is merged in the future, we'll need to cherry-pick this doc PR to the release-8.5 branch as well. |
What is changed, added or deleted? (Required)
Adds a Note to the
INFORMATION_SCHEMA.TABLESandINFORMATION_SCHEMA.PARTITIONSreference pages explaining that querying the size columns (AVG_ROW_LENGTH,DATA_LENGTH,INDEX_LENGTH) makes TiDB read per-column size statistics frommysql.stats_histograms(one row per column of every table), which costs noticeably more time and resources on clusters with many tables than querying onlyTABLE_ROWS, which reads only the smallermysql.stats_metatable.This documents the behavior introduced by pingcap/tidb#69955 (fixing pingcap/tidb#69818), where TABLE_ROWS-only queries now skip the
mysql.stats_histogramsread. The note helps users avoid the size columns when they only need the estimated row count.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit
TABLESandPARTITIONSreference documentation about the relative cost of retrieving table size metrics.TABLE_ROWSwhen an estimated row count is needed for better performance on clusters with many tables.