Hint usenl usage /*+ leading(emp,dept) usenl(emp) */

SQL> select /*+ leading(emp,dept) usenl(emp) */ emp.*,dept.* from tb_emp03 emp,tb_dept03 dept where emp.deptno=dept.id;

执行计划
----------------------------------------------------------
Plan hash value: 960397288

----------------------------------------------------------------------------------------
| Id  | Operation          | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |           |  1818K|    97M|       |  8558   (1)| 00:01:43 |
|*  1 |  HASH JOIN         |           |  1818K|    97M|    99M|  8558   (1)| 00:01:43 |
|   2 |   TABLE ACCESS FULL| TB_EMP03  |  2000K|    76M|       |  3601   (1)| 00:00:44 |
|   3 |   TABLE ACCESS FULL| TB_DEPT03 |    10 |   160 |       |     3   (0)| 00:00:01 |
----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("EMP"."DEPTNO"="DEPT"."ID")
   
SQL> select /*+ leading(emp,dept) usenl(dept) */ emp.*,dept.* from tb_emp03 emp,tb_dept03 dept where emp.deptno=dept.id;

执行计划
----------------------------------------------------------
Plan hash value: 960397288

----------------------------------------------------------------------------------------
| Id  | Operation          | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |           |  1818K|    97M|       |  8558   (1)| 00:01:43 |
|*  1 |  HASH JOIN         |           |  1818K|    97M|    99M|  8558   (1)| 00:01:43 |
|   2 |   TABLE ACCESS FULL| TB_EMP03  |  2000K|    76M|       |  3601   (1)| 00:00:44 |
|   3 |   TABLE ACCESS FULL| TB_DEPT03 |    10 |   160 |       |     3   (0)| 00:00:01 |
----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("EMP"."DEPTNO"="DEPT"."ID")

 

posted @ 2020-01-28 04:26  逆火狂飙  阅读(270)  评论(0编辑  收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东