• left join 关联条件位置


    select e.last_name, e.department_id, d.department_name
      from hr.employees e
      left outer join hr.departments d on (e.department_id = d.department_id);
      
      
    select e.last_name, e.department_id, d.department_name
      from hr.employees e
      left outer join hr.departments d on ( d.department_id=e.department_id );
    
    
    
    SQL> select e.last_name, e.department_id, d.department_name
      from hr.employees e
      left outer join hr.departments d on (e.department_id = d.department_id);  2    3  
    
    107 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2296652067
    
    ----------------------------------------------------------------------------------
    | Id  | Operation	   | Name	 | Rows  | Bytes | Cost (%CPU)| Time	 |
    ----------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |		 |   107 |  2889 |     7  (15)| 00:00:01 |
    |*  1 |  HASH JOIN OUTER   |		 |   107 |  2889 |     7  (15)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMPLOYEES	 |   107 |  1177 |     3   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS FULL| DEPARTMENTS |    27 |   432 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("E"."DEPARTMENT_ID"="D"."DEPARTMENT_ID"(+))
    
    
    SQL> select e.last_name, e.department_id, d.department_name
      from hr.employees e
      left outer join hr.departments d on ( d.department_id=e.department_id );  2    3  
    
    107 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2296652067
    
    ----------------------------------------------------------------------------------
    | Id  | Operation	   | Name	 | Rows  | Bytes | Cost (%CPU)| Time	 |
    ----------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |		 |   107 |  2889 |     7  (15)| 00:00:01 |
    |*  1 |  HASH JOIN OUTER   |		 |   107 |  2889 |     7  (15)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMPLOYEES	 |   107 |  1177 |     3   (0)| 00:00:01 |
    |   3 |   TABLE ACCESS FULL| DEPARTMENTS |    27 |   432 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - access("D"."DEPARTMENT_ID"(+)="E"."DEPARTMENT_ID")
    
    
     (e.department_id = d.department_id)和( d.department_id=e.department_id )位置没有影响。
    
    

  • 相关阅读:
    Django创建博客
    使用LR的socket协议进行进行性能测试,转解决方案
    loadrunner测试c/s架构的应用系统
    C/S架构的性能测试
    Win10离线安装.NET Framework 3.5的方法技巧(附离线安装包下载)
    VMWare虚拟机无法连接网络!
    Microsoft Windows XP SP3 官方原版镜像下载,绝对原版加系列号!
    软件cs页面分辨率测试
    C/S结构软件测试要点汇总
    手机访问网站自动跳转到手机版
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352332.html
Copyright © 2020-2023  润新知