Create Statement Insight - #23486
Conversation
|
[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 |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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. ChangesStatement Insight
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
tidb-cloud/Statement Insight
| @@ -0,0 +1 @@ | |||
|
|
|||
There was a problem hiding this comment.
📐 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.
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
TOC-tidb-cloud-premium.mdtidb-cloud/statement-insight.md
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
tidb-cloud/statement-insight.md
|
|
||
| ## 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: |
There was a problem hiding this comment.
There is no SQL Overview panel. Do you mean "Top Contributors" panel?
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
Co-authored-by: Grace Cai <qqzczy@126.com>
| - **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. |
| - **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. |
|
|
||
| ### Trend charts | ||
|
|
||
| The trend chart shows how the selected metric changes over time for the dimension you are viewing. |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
How do customers enable this feature?

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.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit