Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimizer-fix-controls: Add optimizer fix control 47400 for controlling zero estRows #18592

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions optimizer-fix-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ SET SESSION tidb_opt_fix_control = '44262:ON,44389:ON';
- 此开关控制优化器进行启发式访问路径选择的阈值。当某个访问路径(如 `Index_A`)的估算行数远小于其他访问路径时(默认为 `1000` 倍),优化器会跳过代价比较直接选择 `Index_A`。
- `0` 表示关闭此启发式访问路径选择策略。

### [`47400`](https://github.com/pingcap/tidb/issues/47400) <span class="version-mark">从 v8.4.0 版本开始引入</span>

- 默认值:`ON`
- 可选值:`ON`、`OFF`
- 由于查询计划中每个步骤符合条件的行数难以精确估算,优化器有可能会为 `estRows` 估算出一个较小的值。此开关控制是否限制 `estRows` 的最小值。
- `ON`:将 `estRows` 的最小值设置为 1。这是 v8.4.0 中引入的新行为,与 Oracle 和 DB2 等数据库一致。
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- `OFF`:不限制 `estRows` 的最小值,与 v8.4.0 之前版本的行为保持一致。此时,`estRows` 可能为 0。

### [`52869`](https://github.com/pingcap/tidb/issues/52869) <span class="version-mark">从 v8.1.0 版本开始引入</span>

- 默认值:`OFF`
Expand Down