Skip to content

Commit

Permalink
add experimental warning for lock/unlock stats (#14990)
Browse files Browse the repository at this point in the history
* Add temp.md

* Delete temp.md

* add warning
  • Loading branch information
ran-huang authored Oct 9, 2023
1 parent e8a69d5 commit 5ef5c36
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-lock-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ summary: An overview of the usage of LOCK STATS for the TiDB database.

`LOCK STATS` is used to lock the statistics of tables or partitions. When the statistics is locked, TiDB does not automatically update the statistics of the table or partition. For details on the behavior, see [Behaviors of locking statistics](/statistics.md#behaviors-of-locking-statistics).

> **Warning:**
>
> Locking statistics is an experimental feature for the current version. It is not recommended to use it in the production environment.
## Synopsis

```ebnf+diagram
Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-show-stats-locked.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ summary: An overview of the usage of SHOW STATS_LOCKED for the TiDB database.

`SHOW STATS_LOCKED` shows the tables whose statistics are locked.

> **Warning:**
>
> Locking statistics is an experimental feature for the current version. It is not recommended to use it in the production environment.
## Synopsis

```ebnf+diagram
Expand Down
4 changes: 4 additions & 0 deletions sql-statements/sql-statement-unlock-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ summary: An overview of the usage of UNLOCK STATS for the TiDB database.

`UNLOCK STATS` is used to unlock the statistics of a table or tables.

> **Warning:**
>
> Locking statistics is an experimental feature for the current version. It is not recommended to use it in the production environment.
## Synopsis

```ebnf+diagram
Expand Down
4 changes: 4 additions & 0 deletions statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,10 @@ LOAD STATS 'file_name'
## Lock statistics
> **Warning:**
>
> Locking statistics is an experimental feature for the current version. It is not recommended to use it in the production environment.
Starting from v6.5.0, TiDB supports locking statistics. After the statistics of a table or a partition are locked, the statistics of the table cannot be modified and the `ANALYZE` statement cannot be executed on the table. For example:
Create table `t`, and insert data into it. When the statistics of table `t` are not locked, the `ANALYZE` statement can be successfully executed.
Expand Down

0 comments on commit 5ef5c36

Please sign in to comment.