• where t.trans_date=date'2018-06-07'; 等价于 ("T"."TRANS_DATE"=TO_DATE(' 2018-06-07 00:00:00', 'syyyy-m


    explain plan for select *
      from esb2_trans_log t
     where t.trans_date >= 
           to_date('2018-06-07 00:00:00', 'yyyy-mm-dd hh24:mi:ss') 
       and t.trans_date <= 
           to_date('2018-06-07 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ;
           
       select * from table(dbms_xplan.display());
       
        PLAN_TABLE_OUTPUT
    1 Plan hash value: 1868862569
    2  
    3 ---------------------------------------------------------------------------------------------------------
    4 | Id  | Operation              | Name           | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    5 ---------------------------------------------------------------------------------------------------------
    6 |   0 | SELECT STATEMENT       |                |    17M|  3526M|   150K  (1)| 00:30:06 |       |       |
    7 |   1 |  PARTITION RANGE SINGLE|                |    17M|  3526M|   150K  (1)| 00:30:06 |     6 |     6 |
    8 |*  2 |   TABLE ACCESS FULL    | ESB2_TRANS_LOG |    17M|  3526M|   150K  (1)| 00:30:06 |     6 |     6 |
    9 ---------------------------------------------------------------------------------------------------------
    10  
    11 Predicate Information (identified by operation id):
    12 ---------------------------------------------------
    13  
    14  2 - filter("T"."TRANS_DATE"<=TO_DATE(' 2018-06-07 23:59:59', 'syyyy-mm-dd hh24:mi:ss'))




    explain plan for  
     select * from esb2_trans_log t
     where t.trans_date=date'2018-06-07';
           
       select * from table(dbms_xplan.display());
       
          PLAN_TABLE_OUTPUT
    1 Plan hash value: 1868862569
    2  
    3 ---------------------------------------------------------------------------------------------------------
    4 | Id  | Operation              | Name           | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    5 ---------------------------------------------------------------------------------------------------------
    6 |   0 | SELECT STATEMENT       |                |   222 | 46620 |   150K  (1)| 00:30:05 |       |       |
    7 |   1 |  PARTITION RANGE SINGLE|                |   222 | 46620 |   150K  (1)| 00:30:05 |     6 |     6 |
    8 |*  2 |   TABLE ACCESS FULL    | ESB2_TRANS_LOG |   222 | 46620 |   150K  (1)| 00:30:05 |     6 |     6 |
    9 ---------------------------------------------------------------------------------------------------------
    10  
    11 Predicate Information (identified by operation id):
    12 ---------------------------------------------------
    13  
    14  2 - filter("T"."TRANS_DATE"=TO_DATE(' 2018-06-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))




    where t.trans_date=date'2018-06-07';  等价于 ("T"."TRANS_DATE"=TO_DATE(' 2018-06-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  • 相关阅读:
    浮动元素的应用
    网页中选中文字 ,复制的颜色会变化
    JVM指令重排
    JVM相关的几个基本概念
    Cygwin安装apt-cyg
    MySql四种隔离级别
    Django利用form进行显示
    Django在不启动server的情况下调用方法
    Js实现hashMap
    Js编写的菜单树
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349183.html
Copyright © 2020-2023  润新知