Skip to content

Commit

Permalink
add sysvar tidb_enable_plan_replayer_continuous_capture (#13029)
Browse files Browse the repository at this point in the history
  • Loading branch information
ran-huang authored Mar 28, 2023
1 parent 7e9ce68 commit 712f07a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
12 changes: 12 additions & 0 deletions sql-plan-replayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,15 @@ The method of downloading the file of `PLAN REPLAYER CAPTURE` is the same as tha
> **Note:**
>
> The result file of `PLAN REPLAYER CAPTURE` is kept in the TiDB cluster for up to one hour. After one hour, TiDB deletes the file.
## Use `PLAN REPLAYER CONTINUOUS CAPTURE`

After `PLAN REPLAYER CONTINUOUS CAPTURE` is enabled, TiDB asynchronously records the applications' SQL statements with the `PLAN REPLAYER` method according to their `SQL DIGEST` and `PLAN DIGEST`. For SQL statements and execution plans that share the same DIGEST, `PLAN REPLAYER CONTINUOUS CAPTURE` does not record them repeatedly.

### Enable `PLAN REPLAYER CONTINUOUS CAPTURE`

`PLAN REPLAYER CONTINUOUS CAPTURE` is controlled by the system variable [`tidb_enable_plan_replayer_continuous_capture`](/system-variables.md#tidb_enable_plan_replayer_continuous_capture-new-in-v700). To enable `PLAN REPLAYER CONTINUOUS CAPTURE`, set the value of the system variable to `ON`.

### View the capture results

The method of viewing the capture results of `PLAN REPLAYER CONTINUOUS CAPTURE` is the same as that of [Viewing the capture results of `PLAN REPLAYER CAPTURE`](#view-the-capture-results).
19 changes: 15 additions & 4 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1780,16 +1780,27 @@ MPP is a distributed computing framework provided by the TiFlash engine, which a
</CustomContent>
### tidb_enable_plan_replayer_continues_capture
### tidb_enable_plan_replayer_continuous_capture <span class="version-mark">New in v7.0.0</span>
> **Warning:**
>
> The feature controlled by this variable is not fully functional in the current TiDB version. Do not change the default value.
<CustomContent platform="tidb-cloud">
- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `OFF`
- This variable controls whether to enable the `PLAN REPLAYER CONTINUOUS CAPTURE` feature. The default value `OFF` means to disable the feature.
</CustomContent>
<CustomContent platform="tidb">
- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `OFF`
- This variable controls whether to enable the [`PLAN REPLAYER CONTINUOUS CAPTURE` feature](/sql-plan-replayer.md#use-plan-replayer-continuous-capture). The default value `OFF` means to disable the feature.
</CustomContent>
### tidb_enable_prepared_plan_cache <span class="version-mark">New in v6.1.0</span>
Expand Down

0 comments on commit 712f07a

Please sign in to comment.