Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dashboard/top-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ summary: Use Top SQL to identify queries that consume the most CPU, network, and
On the Top SQL page of TiDB Dashboard, you can view and analyze the most resource-consuming SQL queries on a specified TiDB or TiKV node over a period of time.

- After you enable Top SQL, this feature continuously collects CPU workload data from existing TiDB and TiKV nodes and retains the data for up to 30 days.
- Starting from v8.5.6 and v9.0.0, you can also enable **TiKV Network IO collection (multi-dimensional)** in the Top SQL settings to further view metrics such as `Network Bytes` and `Logical IO Bytes` for specified TiKV nodes, and perform aggregation analysis in dimensions of `By Query`, `By Table`, `By DB`, and `By Region`.
- Starting from v8.5.7 and v9.0.0, you can also enable **TiKV Network IO collection (multi-dimensional)** in the Top SQL settings to further view metrics such as `Network Bytes` and `Logical IO Bytes` for specified TiKV nodes, and perform aggregation analysis in dimensions of `By Query`, `By Table`, `By DB`, and `By Region`.
Comment thread
qiancai marked this conversation as resolved.

Top SQL provides the following features:

Expand Down Expand Up @@ -65,7 +65,7 @@ In addition to the UI, you can also enable the Top SQL feature by setting the Ti
SET GLOBAL tidb_enable_top_sql = 1;
```

### (Optional) Enable TiKV Network IO collection <span class="version-mark">New in v8.5.6 and v9.0.0</span>
### (Optional) Enable TiKV Network IO collection <span class="version-mark">New in v8.5.7 and v9.0.0</span>

To view Top SQL by `Order By Network` or `Order By Logical IO` for TiKV nodes, or to use the `By Region` aggregation, you can enable the **Enable TiKV Network IO collection (multi-dimensional)** switch in Top SQL settings and save the changes.

Expand Down Expand Up @@ -117,13 +117,13 @@ The following are the common steps to use Top SQL.

![Select aggregation dimension](/media/dashboard/v8.5-top-sql-usage-select-agg-by.png)

- The default sort order is `Order By CPU` (sorted by CPU time). If you select a TiKV node and have [enabled TiKV Network IO collection (multi-dimensional)](#optional-enable-tikv-network-io-collection-new-in-v856-and-v900), you can also select `Order By Network` (sorted by network bytes) or `Order By Logical IO` (sorted by logical IO bytes).
- The default sort order is `Order By CPU` (sorted by CPU time). If you select a TiKV node and have [enabled TiKV Network IO collection (multi-dimensional)](#optional-enable-tikv-network-io-collection-new-in-v857-and-v900), you can also select `Order By Network` (sorted by network bytes) or `Order By Logical IO` (sorted by logical IO bytes).

![Select order by](/media/dashboard/v8.5-top-sql-usage-select-order-by.png)

> **Note**
>
> `By Region` and `Order By Network`, `Order By Logical IO` are only available when [TiKV Network IO collection (multi-dimensional)](#optional-enable-tikv-network-io-collection-new-in-v856-and-v900) is enabled. If this feature is not enabled but historical data still exists, the page will continue to display historical data and prompt that new data cannot be fully collected.
> `By Region`, `Order By Network`, and `Order By Logical IO` are only available when [TiKV Network IO collection (multi-dimensional)](#optional-enable-tikv-network-io-collection-new-in-v857-and-v900) is enabled. If this feature is not enabled but historical data still exists, the page will continue to display historical data and prompt that new data cannot be fully collected.

5. Observe the resource consumption hotspot records in the chart and table.

Expand Down
2 changes: 1 addition & 1 deletion tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ To reduce write latency, TiKV periodically fetches and caches a batch of timesta

Configuration items related to resource metering.

### `enable-network-io-collection` <span class="version-mark">New in v8.5.6 and v9.0.0</span>
### `enable-network-io-collection` <span class="version-mark">New in v8.5.7 and v9.0.0</span>

+ Controls whether to collect TiKV network traffic and logical I/O information in [Top SQL](/dashboard/top-sql.md) in addition to CPU data.
+ When enabled, TiKV additionally records inbound network bytes, outbound network bytes, logical read bytes, and logical write bytes during request processing.
Expand Down