SQL> select count(*) from tbl_mo_part_01 partition(MO_01) where orgaddr='8615000000000';
COUNT(*)
----------
26
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 2243574388
----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 15 | 3 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 15 | | |
|* 2 | INDEX RANGE SCAN| MO_INX_PT_01 | 13 | 195 | 3 (0)| 00:00:01 |
----------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("ORGADDR"='8615000000000')
filter(TBL$OR$IDX$PART$NUM("TBL_MO_PART_01",0,1,0,ROWID)=1)
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
530 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed[/code]
问题:
1、 为什么两个执行计划不一样。
2、 两个SQL执行为什么不走partition 。
3、 为什么第一个SQL语句分区字段没有索引,会出现TABLE ACCESS BY GLOBAL INDEX ROWID
4、 第二个SQL语句为什么指定了分区不走分区partition range