编者按:
本文作者系杨昱明,现就职于甲骨文公司,从事数据库方面的技术支持。希望能通过发表文章,把一些零散的知识再整理整理。个人主页:https://blog.csdn.net/weixin_50513167,经其本人授权发布。
【免责声明】本公众号文章仅代表个人观点,与任何公司无关。

编辑|SQL和数据库技术(ID:SQLplusDB)
CBO 查询转换系列(深入了解Oracle执行计划)
CBO 查询转换(1):子查询展开机能(Subquery Unnesting)
CBO 查询转换(2):反结合的NULL识别机能(null aware anti-join )
CBO 查询转换(3):结合谓词下推机能(Join Predicate Pushdown)
CBO 查询转换 (4):Group By 配置最优机能(Group By Placement)
CBO查询转换(5):星型转换(Star Transformation)
CBO查询转换(6):子查询关联集展开机能(unnest correlation set subquery)
同之前聊过的 Group By 配置最优机能同等的,还有 Distinct 配置最优机能(Distinct Placement)。
drop table t1 purge;drop table t2 purge;create table t1(c1 number, c2 number not null);create table t2(c1 number, c2 number not null);insert into t1 values (1,1);insert into t1 values (1,2);insert into t1 values (2,2);insert into t2 values (1,2);commit;SQL> SQL> select /*+ place_distinct(t2) */distinct t1.c2, t2.c2from t1, t2where t1.c1 = t2.c1; 2 3 4C2 C2---------- ----------1 22 2Execution Plan----------------------------------------------------------Plan hash value: 107983552-----------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |-----------------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 2 | 104 | 8 (25)| 00:00:01 || 1 | HASH UNIQUE | | 2 | 104 | 8 (25)| 00:00:01 ||* 2 | HASH JOIN | | 2 | 104 | 7 (15)| 00:00:01 || 3 | VIEW | VW_DTP_AE9E49E8 | 1 | 26 | 4 (25)| 00:00:01 || 4 | HASH UNIQUE | | 1 | 26 | 4 (25)| 00:00:01 || 5 | TABLE ACCESS FULL| T2 | 1 | 26 | 3 (0)| 00:00:01 || 6 | TABLE ACCESS FULL | T1 | 3 | 78 | 3 (0)| 00:00:01 |-----------------------------------------------------------------------------------------Predicate Information (identified by operation id):---------------------------------------------------2 - access("T1"."C1"="ITEM_1")Note------ dynamic sampling used for this statement (level=2)
后续文章更加精彩,欢迎关注本公众号或访问【阅读原文】。
——End——
专注于技术不限于技术!
用碎片化的时间,一点一滴地提高数据库技术和个人能力。
欢迎关注!
CBO 查询转换系列(深入了解Oracle执行计划)
CBO 查询转换(1):子查询展开机能(Subquery Unnesting)
CBO 查询转换(2):反结合的NULL识别机能(null aware anti-join )
CBO 查询转换(3):结合谓词下推机能(Join Predicate Pushdown)
CBO 查询转换 (4):Group By 配置最优机能(Group By Placement)
CBO查询转换(5):星型转换(Star Transformation)
CBO查询转换(6):子查询关联集展开机能(unnest correlation set subquery)
数据库漫谈系列(数据库杂谈):
数据库漫谈(九)----云数据库
数据库漫谈(十)----数据库选型
原文作者:SQL和数据库技术;如有侵权,请联系管理员删除。