前面测试中索引列只有一个值为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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16179598/viewspace-668310/