full table scan

create table for tablescan test

 

SQL> execute dbms_random.seed(0)

PL/SQL procedure successfully completed

 

SQL> create table test_tablescan pctfree 99 pctused 1 as
  2  select  rownum id,
  3          trunc(100*dbms_random.normal) val,
  4          rpad('x',100) padding
  5  from all_objects
  6  where  rownum<10000
  7  ;

 

SQL> select * from test_tablescan;

        ID        VAL PADDING
---------- ---------- --------------------------------------------------------------------------------
         1        -69 x
         2        -72 x
         3        -18 x
         4        -62 x
         5         -5 x
         6         61 x
         7        -33 x
         8       -170 x

 

 

 

display the last explain plan  sql output:

SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY())

 

 

Why a Full Table Scan Is Faster for Accessing Large Amounts of Data

Full table scans are cheaper than index range scans when accessing a large fraction of the blocks in a table. This is because full table scans can use larger I/O calls, and making fewer large I/O calls is cheaper than making many smaller calls.

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

转载于:http://blog.itpub.net/20945761/viewspace-558023/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值