Skip to content

sql-statement-drop-stats: fix STATS_META output after DROP STATS - #23557

Open
doc-claw-bot wants to merge 2 commits into
pingcap:masterfrom
doc-claw-bot:docs/fix-drop-stats-meta-example
Open

sql-statement-drop-stats: fix STATS_META output after DROP STATS#23557
doc-claw-bot wants to merge 2 commits into
pingcap:masterfrom
doc-claw-bot:docs/fix-drop-stats-meta-example

Conversation

@doc-claw-bot

@doc-claw-bot doc-claw-bot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

What is changed, added or deleted? (Required)

  • Clarify that DROP STATS removes histogram-related statistics but does not delete the STATS_META row.
  • Update the example output to show that SHOW STATS_META still returns the row count and modify count after DROP STATS.
  • Align the statement page with the current TiDB behavior verified during doc feedback handling.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • Documentation
    • Updated the DROP STATS example to clarify that table metadata, including modification and row counts, is retained.
    • Clarified that histogram statistics, such as TopN and buckets, are cleared.
    • Updated the expected output to include the retained metadata and last analysis time.

@doc-claw-bot doc-claw-bot added the type/bugfix This PR fixes a bug. label Aug 18, 2026
@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. missing-translation-status This PR does not have translation status info. labels Aug 18, 2026
@ti-chi-bot ti-chi-bot Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 18, 2026
@doc-claw-bot doc-claw-bot added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed missing-translation-status This PR does not have translation status info. labels Aug 18, 2026
@ti-chi-bot

ti-chi-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign csuzhangxc for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5ec0dd7c-effc-4bb0-9b6d-5d759d557f2b

📥 Commits

Reviewing files that changed from the base of the PR and between 83b729c and 7ff4102.

📒 Files selected for processing (1)
  • sql-statements/sql-statement-drop-stats.md

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The DROP STATS example now shows that STATS_META retains Modify_count and Row_count while TopN and histogram buckets are cleared.

Changes

DROP STATS documentation

Layer / File(s) Summary
Update STATS_META example
sql-statements/sql-statement-drop-stats.md
The output now includes Last_analyze_time and the retained metadata row after DROP STATS. The example states that TopN and histogram buckets are cleared.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 7ff41

This localized documentation update clarifies the documented DROP STATS and STATS_META behavior without changing product code; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the documentation fix for STATS_META output after DROP STATS.
Description check ✅ Passed The description includes the required change summary, affected version, reference link, AI involvement, and applicability checklist. It is complete and aligned with the pull request objectives.
Docstring Coverage ✅ Passed 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…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qiancai qiancai added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Aug 25, 2026
@qiancai
qiancai force-pushed the docs/fix-drop-stats-meta-example branch from c596d70 to 7ff4102 Compare August 25, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants