Skip to content

Commit

Permalink
Update sql-prepare-plan-cache.md
Browse files Browse the repository at this point in the history
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
  • Loading branch information
eurekaka and yikeke authored May 22, 2020
1 parent c88a7ec commit 9b8ad8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql-prepare-plan-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ key 中任何一项变动,或 LRU 淘汰机制触发都会导致 `Execute` 时
- 考虑到不同 `Execute` 的参数会不同,执行计划缓存为了保证适配性会禁止一些和具体参数值密切相关的激进查询优化手段,导致对特定的一些参数值,查询计划可能不是最优。比如查询的过滤条件为 `where a > ? and a < ?`,第一次 `Execute` 时参数分别为 2 和 1,考虑到这两个参数下次执行时可能会是 1 和 2,优化器不会生成对当前参数最优的 `TableDual` 执行计划。
- 如果不考虑缓存失效和淘汰,一份执行计划缓存会对应各种不同的参数取值,理论上也会导致某些取值下执行计划非最优。执行计划缓存更适用于查询较为简单(查询编译耗时占比较高)且执行计划较为固定的业务场景。

目前执行计划缓存功能默认关闭,可以通过打开配置文件中 [`prepare-plan-cache`](/tidb-configuration-file.md#prepared-plan-cache) 相应项启用这项功能
目前执行计划缓存功能默认关闭,可以通过打开配置文件中 [`prepare-plan-cache`](/tidb-configuration-file.md#prepared-plan-cache) 启用这项功能

> **注意:**
>
Expand Down

0 comments on commit 9b8ad8d

Please sign in to comment.