11g sort merge join
发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,测试sort merge joinWhen the Optimizer Considers Sort Merge JoinsA hash join requires one hash table an
千家信息网最后更新 2025年11月07日11g sort merge join
测试sort merge join
When the Optimizer Considers Sort Merge JoinsA hash join requires one hash table and one probe of this table, whereas a sort merge join requires two sorts.The optimizer may choose a sort merge join over a hash join for joining large amounts of data when any of the following conditions is true:The join condition between two tables is not an equijoin, that is, uses an inequality condition such as <, <=, >, or >=.In contrast to sort merges, hash joins require an equality condition.Because of sorts required by other operations, the optimizer finds it cheaper to use a sort merge.If an index exists, then the database can avoid sorting the first data set. However, the database always sorts the second data set, regardless of indexes.SQL> create table t1 (id number);Table created.SQL> create table t2 (id number);Table created.SQL> insert into t1 values(2);1 row created.SQL> insert into t1 values(1);1 row created.SQL> insert into t1 values(5);1 row created.SQL> insert into t1 values(3);1 row created.SQL> commit;SQL> select * from t1; ID---------- 2 1 5 3SQL> insert into t2 values(11);1 row created.SQL> insert into t2 values(9);1 row created.SQL> insert into t2 values(1);1 row created.SQL> commit;SQL> select * from t2; ID---------- 11 9 1SQL> SQL> exec dbms_stats.gather_table_stats('SYS','T1');PL/SQL procedure successfully completed.SQL> exec dbms_stats.gather_table_stats('SYS','T2');PL/SQL procedure successfully completed.SQL> set autot offSQL> create index ind_id on t1(Id);Index created.SQL> set autot traceonlySQL> select * from t1,t2 where t1.id>t2.id;Execution Plan----------------------------------------------------------Plan hash value: 1335671014------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 2 | 12 | 4 (25)| 00:00:01 || 1 | MERGE JOIN | | 2 | 12 | 4 (25)| 00:00:01 || 2 | SORT JOIN | | 4 | 12 | 1 (0)| 00:00:01 || 3 | INDEX FULL SCAN | IND_ID | 4 | 12 | 1 (0)| 00:00:01 ||* 4 | SORT JOIN | | 3 | 9 | 3 (34)| 00:00:01 || 5 | TABLE ACCESS FULL| T2 | 3 | 9 | 2 (0)| 00:00:01 |------------------------------------------------------------------------------Predicate Information (identified by operation id):--------------------------------------------------- 4 - access(INTERNAL_FUNCTION("T1"."ID")>INTERNAL_FUNCTION("T2"."ID")) filter(INTERNAL_FUNCTION("T1"."ID")>INTERNAL_FUNCTION("T2"."ID"))Statistics---------------------------------------------------------- 1 recursive calls 0 db block gets 3 consistent gets 0 physical reads 0 redo size 652 bytes sent via SQL*Net to client 519 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 2 sorts (memory) 0 sorts (disk) 3 rows processed
测试
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
附加数据库时出错 948
山东省云平台服务器什么时候关闭
德阳市用友软件开发公司地址
infuse 服务器订阅
杰控数据库测试失败
互联网金融科技高校排名
葫芦科数据库
云数据库安全保障方案
鲸鲨云数据库迁移工具
太原火箭网络技术服务公司
魔兽服务器rp pvp
使命召唤游戏连接不上服务器
湖北crm软件开发中心
深圳电脑软件开发定制
安徽池州网络安全倡议
云记软件开发淘宝
中原网络安全创新
互联网科技的温暖
阿里服务器在哪儿
网络安全法知识问答 判断题
惠普服务器低延迟模式
esxi离线下载服务器搭建
2021年网络安全人才需求
无线网络技术试卷及答案
女性的服务器高
在数据库用缩写DB 表示
海康 管理服务器
软件开发合同解除通知
王者荣耀服务器崩溃了1月1号
东城区综合软件开发创新服务