OCP-1Z0-051-V9.02-55题
来源:互联网 发布:爱淘宝流量 编辑:程序博客网 时间:2024/06/03 18:23
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
- OCP-1Z0-051-V9.02-55题
- OCP-1Z0-051-V9.02-1题
- OCP-1Z0-051-V9.02-1题
- OCP-1Z0-051-V9.02-1题
- OCP-1Z0-051-V9.02-11题
- OCP-1Z0-051-V9.02-12题
- OCP-1Z0-051-V9.02-14题
- OCP-1Z0-051-V9.02-15题
- OCP-1Z0-051-V9.02-17题
- OCP-1Z0-051-V9.02-18题
- OCP-1Z0-051-V9.02-21题
- OCP-1Z0-051-V9.02-118题
- OCP-1Z0-051-V9.02-120题
- OCP-1Z0-051-V9.02-32题
- OCP-1Z0-051-V9.02-33题
- OCP-1Z0-051-V9.02-93题
- OCP-1Z0-051-V9.02-94题
- OCP-1Z0-051-V9.02-95题
- 再次理解二进制
- 约瑟夫环O(n)复杂度的解法
- OCP-1Z0-051-V9.02-58题
- 【Android】模拟Android微信APK底部的TabHost选项卡
- sed命令解析
- OCP-1Z0-051-V9.02-55题
- 九度-1165 字符串匹配
- C中位比特操作
- OCP-1Z0-051-V9.02-54题
- 关于C++/C中防止头文件的重复包含的解决办法
- Java SE学习笔记-面向对象
- 给man pages设置颜色
- Android 对图片分配多大的内存
- 架构师牛人