Skip to content

Commit

Permalink
docs: Disable auto_analyze for plan_replayer (#16805) (#16834)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Mar 25, 2024
1 parent 363eccb commit f70d793
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sql-plan-replayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ With an existing `ZIP` file exported using `PLAN REPLAYER`, you can use the `PLA
PLAN REPLAYER LOAD 'file_name';
```

In the statement above, `file_name` is the name of the `ZIP` file to be exported.
In the statement above, `file_name` is the name of the `ZIP` file to be imported.

For example:

Expand All @@ -153,6 +153,16 @@ For example:
PLAN REPLAYER LOAD 'plan_replayer.zip';
```

> **Note:**
>
> You need to disable auto analyze. Otherwise the imported statistics will be overwritten by analyze.
You can disable auto analyze by setting the [`tidb_enable_auto_analyze`](/system-variables.md#tidb_enable_auto_analyze-new-in-v610) system variable to `OFF`:

```sql
set @@global.tidb_enable_auto_analyze = OFF;
```

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:

```sql
Expand Down

0 comments on commit f70d793

Please sign in to comment.