设为首页 加入收藏

TOP

排序合并连接(sort merge join)的原理(二)
2014-11-23 23:37:42 来源: 作者: 【 】 浏览:24
Tags:排序 合并 连接 sort merge join 原理
ct_id = t2.object_id and t1.object_id = 99999 Plan hash value: 1970191094 ------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem | ------------------------------------------------------------------------------------------------------------------- | 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:00.01 | 4 | | | | | 2 | MERGE JOIN | | 1 | 1 | 0 |00:00:00.01 | 4 | | | | |* 3 | TABLE ACCESS FULL | TEST1 | 1 | 1 | 0 |00:00:00.01 | 4 | | | | |* 4 | SORT JOIN | | 0 | 1 | 0 |00:00:00.01 | 0 | 73728 | 73728 | | |* 5 | TABLE ACCESS FULL| TEST2 | 0 | 1 | 0 |00:00:00.01 | 0 | | | | ------------------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter("T1"."OBJECT_ID"=99999) 4 - access("T1"."OBJECT_ID"="T2"."OBJECT_ID") filter("T1"."OBJECT_ID"="T2"."OBJECT_ID") 5 - filter("T2"."OBJECT_ID"=99999) SQL> select /*+ ordered use_merge(t2)*/count(*) from test1 t1, test2 t2 where t1.object_id = t2.object_id and 1=2; COUNT(*) ---------- 0 SQL> select * from table(dbms_xplan.display_cursor(null,null,'allstats last')); PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------------- SQL_ID 3duvzmx0wm2hv, child number 0 ------------------------------------- select /*+ ordered use_merge(t2)*/count(*) from test1 t1, test2 t2 where t1.object_id = t2.object_id and 1=2 Plan hash value: 593691543 ---------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | OMem | 1Mem | Used-Mem | ---------------------------------------------------------------------------------------------------------- | 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:00.01 | | | | |* 2 | FILTER | | 1 | | 0 |00:00:00.01 | | | | | 3 | MERGE JOIN | | 0 | 100 | 0 |00:00:00.01 | | | | | 4 | SORT JOIN | | 0 | 100 | 0 |00:00:00.01 | 73728 | 73728 | | | 5 | TABLE ACCESS FULL| TEST1 | 0 | 100 | 0 |00:00:00.01 | | | | |* 6 | SORT JOIN | | 0 | 1000 | 0 |00:00:00.01 | 73728 | 73728 | | | 7 | TABLE ACCESS FULL| TEST2 | 0 | 1000 | 0 |00:00:00.01 | | | | ---------------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - filter(NULL IS NOT NULL) 6 - access("T1"."OBJECT_ID"="T2"."OBJECT_ID") filter("T1"."OBJECT_ID"="T2"."OBJECT_ID")


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇django:数据库修改工具South的正.. 下一篇postgressql批量增加数据

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: