-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dashboard: update dashboard media files structure (#3359)
* dashboard: update media files structure * fix link Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
- Loading branch information
Showing
37 changed files
with
142 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: 查看执行详情 | ||
summary: 查看单个 SQL 语句执行的详细情况 | ||
category: how-to | ||
--- | ||
|
||
# 查看执行详情 | ||
|
||
在列表中点击任意一行可以进入该 SQL 语句的详情页查看更详细的信息,这此信息包括三大部分: | ||
|
||
- SQL 语句概况:包括 SQL 模板,SQL 模板 ID,当前查看的时间范围,执行计划个数以及执行所在的数据库(下图区域 1) | ||
- 执行计划列表:如果该 SQL 语句有多个执行计划,则显示该列表,可以选择不同的执行计划,在列表下方会显示选中的执行计划详情;如果只有一个执行计划,则该列表不显示(下图区域 2) | ||
- 执行计划详情:显示选中的执行计划的详细信息,具体见下一小节(下图区域 3) | ||
|
||
![详情](/media/dashboard/dashboard-statement-detail.png) | ||
|
||
## 执行计划详情 | ||
|
||
执行计划详情包括以下内容: | ||
|
||
- SQL 样本:该计划对应的实际执行的某一条 SQL 语句文本。时间范围内任何出现过的 SQL 都可能作为 SQL 样本。 | ||
- 执行计划:执行计划的完整内容,参阅[理解 TiDB 执行计划](https://pingcap.com/docs-cn/dev/query-execution-plan/)文档了解如何解读执行计划。如果选择了多个执行计划,则显示的是其中任意一个。 | ||
- 其他关于该 SQL 的基本信息、执行时间、Coprocessor 读取、事务、慢查询等信息,可点击相应标签页标题切换。 | ||
|
||
![执行计划详情](/media/dashboard/dashboard-statement-plans-detail.png) | ||
|
||
### 基本信息 | ||
|
||
包含关于表名、索引名、执行次数、累计耗时等信息。**描述**(Description)列对各个字段进行了具体描述。 | ||
|
||
![基本信息](/media/dashboard/dashboard-statement-plans-basic.png) | ||
|
||
### 执行时间 | ||
|
||
显示执行计划执行的各阶段所耗费时间。 | ||
|
||
> **注意:** | ||
> | ||
> 由于单个 SQL 语句内部可能有并行执行的操作,因此各阶段累加时间可能超出该 SQL 语句的实际执行时间。 | ||
![执行时间](/media/dashboard/dashboard-statement-plans-time.png) | ||
|
||
### Coprocessor 读取 | ||
|
||
显示 Coprocessor 读取的相关信息。 | ||
|
||
![Coprocessor 读取](/media/dashboard/dashboard-statement-plans-cop-read.png) | ||
|
||
### 事务 | ||
|
||
显示执行计划与事务相关的信息,比如平均写入 key 个数,最大写入 key 个数等。 | ||
|
||
![事务](/media/dashboard/dashboard-statement-plans-transaction.png) | ||
|
||
### 慢查询 | ||
|
||
如果该执行计划执行过慢,则在慢查询标签页下可以看到其关联的慢查询记录。 | ||
|
||
![慢查询](/media/dashboard/dashboard-statement-plans-slow-queries.png) | ||
|
||
该区域显示的内容结构与慢查询页面一致,详见[慢查询页面](/dashboard/dashboard-slow-query.md)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: SQL 语句分析页面 | ||
summary: 查看所有 SQL 语句在集群上执行情况 | ||
category: how-to | ||
--- | ||
|
||
# SQL 语句分析页面 | ||
|
||
该页面可以查看所有 SQL 语句在集群上执行情况,常用于分析总耗时或单次耗时执行耗时较长的 SQL 语句。 | ||
|
||
在该页面中,结构一致的 SQL 查询(即使查询参数不一致)都会被归为同一个 SQL 语句,例如 `SELECT * FROM employee WHERE id IN (1, 2, 3)` 和 `select * from EMPLOYEE where ID in (4, 5)` 都属于同一 SQL 语句 `select * from employee where id in (...)`。 | ||
|
||
## 访问列表页面 | ||
|
||
可以通过以下两种方法访问 SQL 语句分析页面: | ||
|
||
- 登录后,左侧导航条点击**SQL 语句分析**(SQL Statements): | ||
|
||
![访问](/media/dashboard/dashboard-statement-access.png) | ||
|
||
- 在浏览器中访问 <http://127.0.0.1:2379/dashboard/#/statement>(将 `127.0.0.1:2379` 替换为实际 PD 实例地址和端口)。 | ||
|
||
SQL 语句分析页面所展示的所有数据都来自于 TiDB Statement 系统表,参见 [Statement Summary Tables](https://pingcap.com/docs-cn/dev/statement-summary-tables) 文档了解该系统表的详细情况。 | ||
|
||
### 修改列表过滤条件 | ||
|
||
页面顶部可修改显示的时间范围、按执行 SQL 所在数据库进行过滤,或按 SQL 类型进行过滤,如下所示。默认显示最近一个收集周期(默认最近 30 分钟)内的所有 SQL 语句执行情况。 | ||
|
||
![修改过滤条件](/media/dashboard/dashboard-statement-filter-options.png) | ||
|
||
### 显示其他字段 | ||
|
||
页面顶部**选择列**(Columns)选项中可选择显示更多列,可将鼠标移动到列名右侧的 (i) 图标处查看列的说明: | ||
|
||
![选择列](/media/dashboard/dashboard-statement-columns-selector.png) | ||
|
||
### 修改列表排序依据 | ||
|
||
列表默认以**累计耗时**(Total Latency)从高到低进行排序,点击不同的列标题可以修改排序依据或切换排序顺序: | ||
|
||
![修改列排序](/media/dashboard/dashboard-statement-change-order.png) | ||
|
||
### 修改数据收集设置 | ||
|
||
在列表页面,点击顶部右侧的**设置**(Settings)按钮,即可对 SQL 语句分析功能进行设置: | ||
|
||
![设置入口](/media/dashboard/dashboard-statement-setting-entry.png) | ||
|
||
点击后设置界面如下图所示: | ||
|
||
![设置](/media/dashboard/dashboard-statement-settings.png) | ||
|
||
在设置中可以选择关闭或开启 SQL 语句分析功能。在开启 SQL 语句分析功能时可以修改以下选项: | ||
|
||
- 数据收集周期:默认 30 分钟,每次进行 SQL 语句分析的时间长度。SQL 语句分析功能每次对一段时间范围内的所有 SQL 语句进行汇总统计,如果这个时间范围过长,则统计的粒度粗,不利用定位问题;如果太短,则统计的粒度细,方便定位问题,但会导致在相同的数据保留时间内产生更多的记录,产生更多的内存占用。因此需要根据实际情况调整,在需要定位问题时适当地将值调低。 | ||
- 数据保留时间:默认 1 天,统计信息保留的时间,超过这个时间的数据会被从系统表中删除。 | ||
|
||
参见 [Statement Summary Tables 参数设置](https://pingcap.com/docs-cn/dev/statement-summary-tables/#%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) 文档了解详细情况。 | ||
|
||
> **注意:** | ||
> | ||
> 由于 Statement 系统表只存放在内存中,关闭此功能后,系统表中的数据会将清空。 | ||
> | ||
> 数据收集周期和保留时间的值会影响内存占用,因此建议根据实际情况调整,保留时间不宜设置过大。 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes