指定子查询不展开的Hint

功能描述

数据库在对查询进行逻辑优化时通常会将可以提升的子查询提升到上层来避免嵌套执行,但对于某些本身选择率较低且可以使用索引过滤访问页面的子查询,嵌套执行不会导致性能下降过多,而提升之后扩大了查询路径的搜索范围,可能导致性能变差。对于此类情况,可以使用no_expand Hint进行调试。大多数情况下不建议使用此hint。

语法格式

no_expand

示例

正常的查询执行

explain select * from t1 where t1.a in (select t2.a from t2);

计划

加入no_expand

explain select * from t1 where t1.a in (select /*+ no_expand*/ t2.a from t2);

计划

意见反馈
编组 3备份
openGauss 2024-03-19 00:49:40
取消