hash join 内连接改变驱动表:
select /*+ swap_join_inputs(e) use_hash(e,d)*/ e.ename,e.job,d.dname from emp e,dept d where e.deptno=d.deptno
SQL> explain plan for select /*+ swap_join_inputs(e) use_hash(e,d)*/ e.ename,e.job,d.dname from emp e,dept d where e.deptno=d.deptno ;
已解释。
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 1123238657
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 14 | 420 | 6 (0)| 00:00:01 |
|* 1 | HASH JOIN | | 14 | 420 | 6 (0)| 00:00:01 |
| 2 | TABLE ACCESS
hash join 内连接可以指定驱动表
最新推荐文章于 2022-10-21 15:39:11 发布