ITPub博客

首页 > Linux操作系统 > Linux操作系统 > full table scan

full table scan

原创 Linux操作系统 作者:arthurshen_bleum 时间:2009-02-27 09:48:28 0 删除 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

上一篇: sql statement_常用
下一篇: 锁的管理
请登录后发表评论 登录
全部评论

注册时间:2009-02-26

  • 博文量
    36
  • 访问量
    27062