Pro ORACLE SQL一书错误之处
来源:互联网 发布:网上找淘宝客服 编辑:程序博客网 时间:2024/06/05 02:57
书中87页
作者讲解 Index Fast Full Scan
引用了2个例子
一个是列允许为null,走了全表扫描
一个是列不允许为null,走的是INDEX FULL SCAN,我就纳闷了,这里明明讲的是Index Fast Full Scan结果例子是INDEX FULL SCAN
Index Fast Full Scan
An index fast full scan is more like a full table scan than like other index scan types. When an index
fast full scan operation is chosen, all the index blocks are read using multiblock reads. This type of
scan is chosen as an alternative to a full table scan when all the columns needed to satisfy the query’s
column list are included in the index and at least one column in the index has the NOT NULL constraint.
In this case, the data is accessed from the index instead of having to access table blocks. Unlike other
index scan types, the index fast full scan cannot be used to avoid a sort since the blocks are read using
unordered multiblock reads. Listing 3-16 shows an example of an index fast full scan plan.
Listing 3-16. Index Fast Full Scan
SQL> alter table hr.employees modify (email null) ;
Table altered.
SQL> set autotrace traceonly explain
SQL> select email from hr.employees
Execution Plan
----------------------------------------------------------
Plan hash value: 1445457117
--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
--------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 107 | 856 | 3 (0)|
| 1 | TABLE ACCESS FULL| EMPLOYEES | 107 | 856 | 3 (0)|
--------------------------------------------------------------------
SQL> set autotrace off
SQL>
SQL> alter table hr.employees modify (email not null) ;
Table altered.
SQL> set autotrace traceonly explain
SQL> select email from hr.employees ;
Execution Plan
----------------------------------------------------------
Plan hash value: 2196514524
----------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
----------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 107 | 856 | 1 (0)|
| 1 | INDEX FULL SCAN | EMP_EMAIL_UK | 107 | 856 | 1 (0)|
----------------------------------------------------------------------
This example demonstrates how the index fast full scan operation relies on the NOT NULL
constraint in order to be chosen. Without the constraint, a full scan operation is chosen instead.
呵呵,虽然书中有错误,不过这本书确实是一本好书,大家有空可以读读
- Pro ORACLE SQL一书错误之处
- pro*c 动态sql一
- oracle pro*c之 sqlca
- Oracle Pro*C 动态SQL技术
- oracle之sql笔记(一)
- oracle错误(一) ORA-各种常见java.sql.SQLException小结
- ORACLE PL/SQL编程之五: 异常错误处理
- ORACLE PL/SQL编程之五:异常错误处理
- ORACLE PL/SQL编程之五:异常错误处理
- ORACLE PL/SQL编程详解之五:异常错误处理
- ORACLE PL/SQL编程之五:异常错误处理
- Oracle Study之--PL/SQL Developer软件错误
- Pro*C中对Oracle PL/SQL块的调用
- [Oracle]高效的SQL语句之分析函数(一)--sum()
- [Oracle]高效的SQL语句之分析函数(一)--sum()
- [Oracle]高效的SQL语句之分析函数(一)--sum()
- [Oracle]高效的SQL语句之分析函数(一)--sum()
- SQL语句性能调整之ORACLE的执行计划(一)
- NO.1 初识C#,传说中的HELLO
- POJ 3090 Visible Lattice Points 欧拉函数
- 运算时间差好多的语法
- NO.2 验证密码例子
- NO.3 if 语句练习
- Pro ORACLE SQL一书错误之处
- Oracle 11G中的Edition-Based Redefinition(CrossEdition)
- 2011~2012总体计划,以及职业规划
- 灌入电流与输入电流
- 使用Annotation配置Action
- Web应用程序访问过程
- 文件浏览对话框(旧式的文件浏览对话框)
- flex不能正确显示音标解决方法
- JSP技术