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

planner: plan cache support subquery #13228

Merged
merged 9 commits into from
Mar 20, 2023
3 changes: 2 additions & 1 deletion sql-prepared-plan-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ TiDB 优化器对这两类查询的处理是一样的:`Prepare` 时将参数

- `SELECT`、`UPDATE`、`INSERT`、`DELETE`、`Union`、`Intersect`、`Except` 以外的 SQL 语句;
- 访问分区表、临时表或访问表中包含生成列的查询;
- 包含子查询的查询,如 `select * from t where a > (select ...)`;
- 查询中包含非关联子查询的,例如 `select * from t1 where t1.a > (select 1 from t2 where t2.b < 1)`
fzzf678 marked this conversation as resolved.
Show resolved Hide resolved
- 执行计划中带有 `PhysicalApply` 算子的关联子查询,例如 `select * from t1 where t1.a > (select a from t2 where t1.b > t2.b)`
fzzf678 marked this conversation as resolved.
Show resolved Hide resolved
- 包含 `ignore_plan_cache` 这一 Hint 的查询,例如 `select /*+ ignore_plan_cache() */ * from t`;
- 包含除 `?` 外其他变量(即系统变量或用户自定义变量)的查询,例如 `select * from t where a>? and b>@x`;
- 查询包含无法被缓存函数。目前不能被缓存的函数有:`database()`、`current_user`、`current_role`、`user`、`connection_id`、`last_insert_id`、`row_count`、`version`、`like`;
Expand Down