http://yangtingkun.itpub.net/post/468/500728
杨老师,我试你这个例子,结果不太一样,不过我是在11G的环境中。
select time,count(*) from test_par where time>to_date('2009-1-1','yyyy-mm-dd')
and time < to_date('2009-1-31','yyyy-mm-dd') group by time;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
| Pstart| Pstop |
--------------------------------------------------------------------------------
-------------------
| 0 | SELECT STATEMENT | | 30 | 240 | 71 (2)| 00:00:0
1 | | |
| 1 | PARTITION RANGE SINGLE| | 30 | 240 | 71 (2)| 00:00:0
1 | 3 | 3 |
| 2 | HASH GROUP BY | | 30 | 240 | 71 (2)| 00:00:0
1 | | |
|* 3 | TABLE ACCESS FULL | TEST_PAR | 30 | 240 | 70 (0)| 00:00:0
1 | 3 | 3 |
--------------------------------------------------------------------------------
这个走的都不是物化视图。跨分区了会走物化视图。
select time,count(*) from test_par where time>to_date('2009-1-1','yyyy-mm-dd')
and time < to_date('2010-1-31','yyyy-mm-dd') group by time;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)
| Time |
--------------------------------------------------------------------------------
------------
| 0 | SELECT STATEMENT | | 395 | 4345 | 126 (3)
| 00:00:02 |
|* 1 | MAT_VIEW REWRITE ACCESS FULL| MV_TEST_PAR | 395 | 4345 | 126 (3)
| 00:00:02 |
--------------------------------------------------------------------------------
------------
为什么????
请杨老师指点。
俺Q273002188.谢谢
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-714473/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25099483/viewspace-714473/