|
leonarding 发表于 2013-3-28 10:25 ![]()
你把 扫描范围 扩大些试试
SQL> select count(*) from PARTITION_LEO9 partition(p1);
COUNT(*)
----------
9716
SQL> set autot on
SQL> select /*+ index(partition_leo9 idx_partition_leo9) */ count(*) from partition_leo9 where object_id>1000 and object_id<9700;
COUNT(*)
----------
8426
Execution Plan
----------------------------------------------------------
Plan hash value: 549732231
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 4 | 18 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 4 | | |
|* 2 | INDEX RANGE SCAN| IDX_PARTITION_LEO9 | 8455 | 33820 | 18 (0)| 00:00:01 |
----------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("OBJECT_ID">1000 AND "OBJECT_ID"<9700)
Statistics
----------------------------------------------------------
3 recursive calls
0 db block gets
30 consistent gets
26 physical reads
0 redo size
527 bytes sent via SQL*Net to client
520 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> select /*+ index(partition_leo10 idx_partition_leo10) */ count(*) from partition_leo10 where object_id>1000 and object_id<9700;
COUNT(*)
----------
8426
Execution Plan
----------------------------------------------------------
Plan hash value: 785094176
---------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
---------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 4 | 20 (0)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 4 | | | | |
| 2 | PARTITION RANGE SINGLE| | 8455 | 33820 | 20 (0)| 00:00:01 | 1 | 1 |
|* 3 | INDEX RANGE SCAN | IDX_PARTITION_LEO10 | 8455 | 33820 | 20 (0)| 00:00:01 | 1 | 1 |
---------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - access("OBJECT_ID">1000 AND "OBJECT_ID"<9700)
Statistics
----------------------------------------------------------
89 recursive calls
0 db block gets
134 consistent gets
20 physical reads
0 redo size
527 bytes sent via SQL*Net to client
520 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
9 sorts (memory)
0 sorts (disk)
1 rows processed |
|