【基礎篇一致性讀】一致性讀分析(續)

yellowlee發表於2010-07-18

前面測試中索引列只有一個值為null,現在大致測試一下10000左右的null的情況。

Update t_test_notequ1 a set a.object_id = null where rownum <10000;

SQL> analyze index idx_test_notequ1 compute statistics;

 

索引已分析

SQL> analyze table  t_test_notequ1 compute statistics;

 

SQL> select /*+ index(a) */* from t_test_notequ1 a where a.object_id > 1 ;

 

已選擇49623行。

 

 

執行計劃

----------------------------------------------------------

Plan hash value: 3227361085

 

--------------------------------------------------------------------------------

 

----------------

 

| Id  | Operation                   | Name             | Rows  | Bytes | Cost (%

 

CPU)| Time     |

 

--------------------------------------------------------------------------------

 

----------------

 

|   0 | SELECT STATEMENT            |                  | 49623 |  4070K|  1037

 (1)| 00:00:13 |

 

|   1 |  TABLE ACCESS BY INDEX ROWID| T_TEST_NOTEQU1   | 49623 |  4070K|  1037

 (1)| 00:00:13 |

 

|*  2 |   INDEX RANGE SCAN          | IDX_TEST_NOTEQU1 | 49623 |       |   341

 (1)| 00:00:05 |

 

--------------------------------------------------------------------------------

 

----------------

 

 

Predicate Information (identified by operation id):

---------------------------------------------------

 

   2 - access("A"."OBJECT_ID">1)

 

 

統計資訊

----------------------------------------------------------

          0  recursive calls

          0  db block gets

       1131  consistent gets

          0  physical reads

          0  redo size

    4879636  bytes sent via SQL*Net to client

        924  bytes received via SQL*Net from client

         51  SQL*Net roundtrips to/from client

          0  sorts (memory)

          0  sorts (disk)

      49623  rows processed

 

SQL>

SQL> select (49623/1000+384*49623/59622)*2 + 384 from dual;

 

(49623/1000+384*49623/59622)*2

------------------------------

              1122.44736862232

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16179598/viewspace-668310/,如需轉載,請註明出處,否則將追究法律責任。

相關文章