forked from pingcap/docs-cn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cherry pick pingcap#3362 to release-3.1
Signed-off-by: ti-srebot <[email protected]>
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
title: LOAD STATS | ||
summary: TiDB 数据库中 LOAD STATS 的使用概况。 | ||
category: reference | ||
--- | ||
|
||
# LOAD STATS | ||
|
||
`LOAD STATS` 语句用于将统计信息加载到 TiDB 中。 | ||
|
||
## 语法图 | ||
|
||
**LoadStatsStmt:** | ||
|
||
![LoadStatsStmt](/media/sqlgram/LoadStatsStmt.png) | ||
|
||
## 参数说明 | ||
|
||
用户直接指定统计信息文件路径,统计信息文件可通过访问 API `http://${tidb-server-ip}:${tidb-server-status-port}/stats/dump/${db_name}/${table_name}` 进行下载。 | ||
|
||
路径可以是相对路径,也可以是绝对路径,如果是相对路径,会从启动 `tidb-server` 的路径为起点寻找对应文件。 | ||
|
||
下面是一个绝对路径的例子: | ||
|
||
{{< copyable "sql" >}} | ||
|
||
```sql | ||
LOAD STATS '/tmp/stats.json'; | ||
``` | ||
|
||
``` | ||
Query OK, 0 rows affected (0.00 sec) | ||
``` | ||
|
||
## 另请参阅 | ||
|
||
* [统计信息](/statistics.md) |