Skip to content

Commit

Permalink
cherry pick pingcap#3362 to release-3.1
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>
  • Loading branch information
qw4990 authored and ti-srebot committed Jun 17, 2020
1 parent d2f6fbc commit 783f527
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions sql-statements/sql-statement-load-stats.md
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)

0 comments on commit 783f527

Please sign in to comment.