Skip to content

Commit 15369f2

Browse files
authored
revise plan replayer load (#11976) (#12002)
1 parent c58a2ad commit 15369f2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

sql-plan-replayer.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,36 @@ For example:
104104
```sql
105105
PLAN REPLAYER LOAD 'plan_replayer.zip';
106106
```
107+
108+
After the cluster information is imported, the TiDB cluster is loaded with the required table schema, statistics and other information that affects the construction of the execution plan. You can view the execution plan and verify statistics in the following way:
109+
110+
```sql
111+
mysql> desc t;
112+
+-------+---------+------+------+---------+-------+
113+
| Field | Type | Null | Key | Default | Extra |
114+
+-------+---------+------+------+---------+-------+
115+
| a | int(11) | YES | | NULL | |
116+
| b | int(11) | YES | | NULL | |
117+
+-------+---------+------+------+---------+-------+
118+
2 rows in set (0.01 sec)
119+
120+
mysql> explain select * from t where a = 1 or b =1;
121+
+-------------------------+---------+-----------+---------------+--------------------------------------+
122+
| id | estRows | task | access object | operator info |
123+
+-------------------------+---------+-----------+---------------+--------------------------------------+
124+
| TableReader_7 | 0.01 | root | | data:Selection_6 |
125+
| └─Selection_6 | 0.01 | cop[tikv] | | or(eq(test.t.a, 1), eq(test.t.b, 1)) |
126+
| └─TableFullScan_5 | 6.00 | cop[tikv] | table:t | keep order:false, stats:pseudo |
127+
+-------------------------+---------+-----------+---------------+--------------------------------------+
128+
3 rows in set (0.00 sec)
129+
130+
mysql> show stats_meta;
131+
+---------+------------+----------------+---------------------+--------------+-----------+
132+
| Db_name | Table_name | Partition_name | Update_time | Modify_count | Row_count |
133+
+---------+------------+----------------+---------------------+--------------+-----------+
134+
| test | t | | 2022-08-26 15:52:07 | 3 | 6 |
135+
+---------+------------+----------------+---------------------+--------------+-----------+
136+
1 row in set (0.04 sec)
137+
```
138+
139+
After the scene is loaded and restored, you can diagnose and improve the execution plan for the cluster.

0 commit comments

Comments
 (0)