zoukankan      html  css  js  c++  java
  • OCP-1Z0-051-V9.02-55题

    55. Evaluate the following two queries:
    SQL> SELECT cust_last_name, cust_city     
    FROM customers     
    WHERE cust_credit_limit IN (1000, 2000, 3000);
    SQL> SELECT cust_last_name, cust_city     
    FROM customers     
    WHERE cust_credit_limit = 1000 OR cust_credit_limit = 2000 OR cust_credit_limit = 3000; 
    Which statement is true regarding the above two queries?
    A. Performance would improve in query 2.
    B. Performance would degrade in query 2.
    C. There would be no change in performance.
    D. Performance would improve in query 2 only if there are null values in the CUST_CREDIT_LIMIT
    column.
    Answer: C
    答案解析:
    sh@TESTDB> SELECT cust_last_name, cust_city     
      2  FROM customers     
      3  WHERE cust_credit_limit IN (1000, 2000, 3000);
    7975 rows selected.
    Elapsed: 00:00:00.07
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2008213504
    -------------------------------------------------------------------------------
    | Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |           | 20556 |   441K|   406   (1)| 00:00:05 |
    |*  1 |  TABLE ACCESS FULL| CUSTOMERS | 20556 |   441K|   406   (1)| 00:00:05 |
    -------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter("CUST_CREDIT_LIMIT"=1000 OR "CUST_CREDIT_LIMIT"=2000 OR
                  "CUST_CREDIT_LIMIT"=3000)
    sh@TESTDB> SELECT cust_last_name, cust_city     
      2  FROM customers     
      3  WHERE cust_credit_limit = 1000 OR cust_credit_limit = 2000 OR cust_credit_limit = 3000;
    7975 rows selected.
    Elapsed: 00:00:00.08
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2008213504
    -------------------------------------------------------------------------------
    | Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |           | 20556 |   441K|   406   (1)| 00:00:05 |
    |*  1 |  TABLE ACCESS FULL| CUSTOMERS | 20556 |   441K|   406   (1)| 00:00:05 |
    -------------------------------------------------------------------------------
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter("CUST_CREDIT_LIMIT"=1000 OR "CUST_CREDIT_LIMIT"=2000 OR
                  "CUST_CREDIT_LIMIT"=3000)
    一样的执行计划,性能一样,故选C
  • 相关阅读:
    代码混淆那些事
    Windows10环境下 Nginx+ffmpeg自搭服务器制作RTMP直播流
    在Windows下搭建基于nginx的视频直播和点播系统
    windows下搭建基于nginx的rtmp服务器
    ijkplayer相关
    直播技术总结(三)ijkplayer的一些问题优化记录
    【.NET深呼吸】应用上下文(AppContext)
    【Win 10应用开发】自定义浮动层——Flyout
    【Win 10应用开发】AdaptiveTrigger在自定义控件中是可以触发的
    【.NET深呼吸】元组数据(Tuple)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317224.html
Copyright © 2011-2022 走看看