设为首页 加入收藏

TOP

Oracle Index Clustering Factor(集群因子)(四)
2018-01-17 13:05:29 】 浏览:393
Tags:Oracle Index Clustering Factor 集群 因子


System altered.


SQL> set autotrace traceonly;
  ----查询一个范围的执行计划----
SQL> select * from jack where object_id>1000 and object_id<2000;


9880 rows selected.



Execution Plan
----------------------------------------------------------
Plan hash value: 949574992


--------------------------------------------------------------------------
| Id  | Operation      | Name | Rows  | Bytes | Cost (%CPU)| Time    |
--------------------------------------------------------------------------
|  0 | SELECT STATEMENT  |    |  9657 |  914K|  1824  (1)| 00:00:22 |
|*  1 |  TABLE ACCESS FULL| JACK |  9657 |  914K|  1824  (1)| 00:00:22 |
--------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


  1 - filter("OBJECT_ID"<2000 AND "OBJECT_ID">1000)



Statistics
----------------------------------------------------------
      0  recursive calls
      0  db block gets
    10993 consistent gets
    10340 physical reads
      0  redo size
  471945 bytes sent via SQL*Net to client
    7657  bytes received via SQL*Net from client
    660  SQL*Net roundtrips to/from client
      0  sorts (memory)
      0  sorts (disk)
    9880  rows processed      ----注意,object_id上是有索引的,但是这里并没有使用索引,而是使用了全表扫描。


SQL> alter system flush buffer_cache;


System altered.


 ----强制走索引,查看执行计划----
SQL> select /*+ index(jack jack_ind) */ * from jack where object_id>1000 and object_id<2000;


9880 rows selected.



Execution Plan
----------------------------------------------------------
Plan hash value: 2860868395


----------------------------------------------------------------------------------------
| Id  | Operation            | Name    | Rows  | Bytes | Cost (%CPU)| Time    |
----------------------------------------------------------------------------------------
|  0 | SELECT STATEMENT        |          |  9657 |  914K|  9683    (1)| 00:01:57 |
|  1 |  TABLE ACCESS BY INDEX ROWID| JACK    |  9657 |  914K|  9683    (1)| 00:01:57 |
|*  2 |  INDEX RANGE SCAN        | JACK_IND |  9657 |      |    24    (0)| 00:00:01 |
----------------------------------------------------------------------------------------


Predicate Information (identified by operation id):
---------------------------------------------------


  2 - access("OBJECT_ID">1000 AND "OBJECT_ID"<2000)



Statistics
----------------------------------------------------------
      0    recursive calls
      0    db block gets
    10561  consistent gets
    164    physical reads
      0    redo size
  988947  bytes sent via SQL*Net to client
&nb

首页 上一页 1 2 3 4 5 下一页 尾页 4/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL 5.7设置简单密码报错ERROR .. 下一篇MySQL binlog日志存放位置的修改

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目