Full Table Scan!

下面列出来的这些条件都会执行 Full Table Scan,因此我们在使用时要特别注意![@more@]
RBO Path 15: Full Table Scan

This access path is available for any SQL statement, regardless of its WHERE clause conditions, except when its FROM clause contains SAMPLE or SAMPLE BLOCK.

Note that the full table scan is the lowest ranked access path on the list. This means that the RBO always chooses an access path that uses an index if one is available, even if a full table scan might execute faster.

The following conditions make index access paths unavailable:

  • column1 > column2
  • column1 < column2
  • column1 >= column2
  • column1 <= column2

where column1 and column2 are in the same table.

  • column IS NULL
  • column IS NOT NULL
  • column NOT IN
  • column != expr
  • column LIKE '%pattern'

regardless of whether column is indexed.

  • expr = expr2

where expr is an expression that operates on a column with an operator or function, regardless of whether the column is indexed.

  • NOT EXISTS subquery
  • ROWNUM pseudocolumn in a view
  • Any condition involving a column that is not indexed

Any SQL statement that contains only these constructs and no others that make index access paths available must use full table scans.

For example: The following statement uses a full table scan to access the emp table:

SELECT * 
    FROM emp; 

The EXPLAIN PLAN output for this statement might look like this:

OPERATION                 OPTIONS        OBJECT_NAME 
----------------------------------------------------- 
SELECT STATEMENT 
  TABLE ACCESS            FULL           EMP 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/19602/viewspace-1003275/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/19602/viewspace-1003275/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值