Skip to content

Commit

Permalink
include the description of critical issue 51407 in doc (#16832)
Browse files Browse the repository at this point in the history
  • Loading branch information
songrijie authored Mar 29, 2024
1 parent 8e6656f commit 538cf09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sql-prepared-plan-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ aliases: ['/tidb/dev/sql-prepare-plan-cache']

# SQL Prepared Execution Plan Cache

> **Warning:**
>
> If a cached `UPDATE` or `DELETE` statement encounters a DDL operation that modifies the relevant schema during execution, it might cause data inconsistency between tables and indexes. For more information, see [Issue #51407](https://github.com/pingcap/tidb/issues/51407). It is recommended to monitor the status of this issue and upgrade to [the latest LTS version](https://docs.pingcap.com/tidb/stable) to resolve this issue. Before upgrading, you can try the following workarounds:
>
> - Before executing DDL, temporarily [disable the prepared plan cache](/system-variables.md#tidb_enable_prepared_plan_cache-new-in-v610), and re-enable it after the DDL is complete.
> - Avoid executing DDL during business peak hours. After executing DDL, immediately run [`ADMIN CHECK TABLE`](/sql-statements/sql-statement-admin-check-table-index.md) to check the consistency between tables and indexes. If errors are found, rebuild the relevant indexes.
TiDB supports execution plan caching for `Prepare` and `Execute` queries. This includes both forms of prepared statements:

- Using the `COM_STMT_PREPARE` and `COM_STMT_EXECUTE` protocol features.
Expand Down

0 comments on commit 538cf09

Please sign in to comment.