Skip to content

Create Statement Insight - #23486

Open
huoyao1125 wants to merge 15 commits into
release-8.5from
huoyao1125-patch-2
Open

Create Statement Insight#23486
huoyao1125 wants to merge 15 commits into
release-8.5from
huoyao1125-patch-2

Conversation

@huoyao1125

@huoyao1125 huoyao1125 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

First-time contributors' checklist

What is changed, added or deleted? (Required)

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.

  • 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)?

  • This PR is translated from:
  • Other reference 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
    • Added a preview-marked Statement Insight page to the TiDB Cloud Premium documentation.
    • Documented access steps, historical data collection, filters, RU and latency metrics, execution details, dimensional summaries, leaderboards, and trend charts.
    • Added information about limitations, data retention, and FAQs comparing Statement Insight with Top RU and billing data.
    • Added Statement Insight to the Monitor and Alert table of contents.

@ti-chi-bot

ti-chi-bot Bot commented Aug 10, 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 qiancai 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

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds a Statement Insight documentation page and links it from the TiDB Cloud Premium table of contents. The page covers access, filters, metrics, charts, limitations, and FAQs.

Changes

Statement Insight

Layer / File(s) Summary
Statement Insight access and navigation
tidb-cloud/statement-insight.md, TOC-tidb-cloud-premium.md
The page documents preview availability, historical data behavior, prerequisites, and console access. The table of contents adds a Preview-labeled link under Monitor and Alert.
Statement Insight analysis and FAQs
tidb-cloud/statement-insight.md
The page documents filters, SQL Overview metrics, dimensional summaries, trend charts, data freshness, aggregation limits, and differences from Top RU and billing data.

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

Suggested labels: area/tidb-cloud

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains the template but provides no change summary, version selection, links, or other required information. Add the change summary, select the applicable TiDB version, and complete the reference, AI involvement, and change-type sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding Statement Insight documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch huoyao1125-patch-2

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1179b5d9-f382-43f8-9471-a12f0a5f6811

📥 Commits

Reviewing files that changed from the base of the PR and between 84444c6 and 2f87b4e.

📒 Files selected for processing (1)
  • tidb-cloud/Statement Insight

Comment thread tidb-cloud/Statement Insight Outdated
@@ -0,0 +1 @@

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Add the requested documentation content before merging.

tidb-cloud/Statement Insight contains only blank lines. This change does not implement the PR objective to add “Create Statement Insight” documentation.

Adds the Statement Insight (Preview) page for TiDB Cloud Premium,
covering multi-dimensional RU/latency/execution-count analysis by
DB User, SQL Type, and SQL Digest, and registers it in the Premium
navigation.
@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fd15e83c-9a79-42d0-80f2-c0583b5bcd3d

📥 Commits

Reviewing files that changed from the base of the PR and between 2f87b4e and 2aec0d9.

📒 Files selected for processing (2)
  • TOC-tidb-cloud-premium.md
  • tidb-cloud/statement-insight.md

Comment thread tidb-cloud/statement-insight.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b6daf13b-b7fb-43bb-83dc-4ef9186dcf2e

📥 Commits

Reviewing files that changed from the base of the PR and between 2aec0d9 and 1000511.

📒 Files selected for processing (1)
  • tidb-cloud/statement-insight.md

Comment thread tidb-cloud/statement-insight.md Outdated
@CLAassistant

CLAassistant commented Aug 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread tidb-cloud/statement-insight.md Outdated
Comment thread tidb-cloud/statement-insight.md Outdated

## Analyze RU consumption, latency, and execution counts

The **SQL Overview** panel summarizes the SQL statements that match your filters, sliced by multiple dimensions. For each dimension, you can switch the **Measured by** control to change which metric drives both the leaderboard and the trend chart:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no SQL Overview panel. Do you mean "Top Contributors" panel?

Comment thread tidb-cloud/statement-insight.md Outdated
Comment thread tidb-cloud/statement-insight.md Outdated
huoyao1125 and others added 3 commits August 17, 2026 17:07
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>

@huoyao1125 huoyao1125 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

applied

@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 17, 2026
- **SQL Type**: filter by SQL statement type, such as `SELECT`, `INSERT`, or `UPDATE`.
- **Database**: filter by the database that the SQL statements ran against.
- **Table**: filter by the table that the SQL statements ran against.
- **SQL Digest**: filter by a specific SQL digest.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is no filter for SQL Digest. Do you mean a keyword filter?
image

Suggested change
- **SQL Digest**: filter by a specific SQL digest.
- **Keyword**: filter by a keyword that matches the SQL digest text.

- **Mean RU**: total RU divided by execution count.
- **Total latency**: the sum of execution latency.
- **Mean latency**: total latency divided by execution count.
- **Execution count**: the number of times the SQL statements were executed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

missing “Plans Count”


### Trend charts

The trend chart shows how the selected metric changes over time for the dimension you are viewing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The trend chart shows how the selected metric changes over time for the dimension you are viewing.
The **Resource Usage Over Time** trend chart shows how the selected metric changes over time for the dimension you are viewing.


### Why is there no data, or only a short time range of data, in Statement Insight?

Statement Insight does not backfill historical data. Data starts accumulating from the moment the feature is enabled on your instance, and the available time range grows over time. If you enabled the feature recently, this is expected behavior, not a sign of missing or broken data.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How do customers enable this feature?

@qiancai qiancai self-assigned this Aug 17, 2026
@qiancai qiancai added translation/no-need No need to translate this PR. area/tidb-cloud This PR relates to the area of TiDB Cloud. labels Aug 17, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tidb-cloud This PR relates to the area of TiDB Cloud. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants