rownum>0 禁用視圖合併,(謂詞推入)
/*+no_merge(view_name)*/禁用視圖合併,
SQL> select * from (select * from t1 ) where object_id>100000;
未選定行
執行計劃
----------------------------------------------------------
Plan hash value: 3204894120
--------------------------------------------------------------------------------
----------------
| Id | Operation | Name | Rows | Bytes | Cost (%
CPU)| Time |
--------------------------------------------------------------------------------
----------------
| 0 | SELECT STATEMENT | | 1 | 481 | 1
(0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID BATCHED| T1 | 1 | 481 | 1
(0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | IDX000A1 | 1 | | 1
(0)| 00:00:01 |
--------------------------------------------------------------------------------
----------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("T1"."OBJECT_ID">100000)
Note
-----
- dynamic statistics used: dynamic sampling (level=2)
統計信息
----------------------------------------------------------
12 recursive calls
6 db block gets
94 consistent gets
1 physical reads
0 redo size
2168 bytes sent via SQL*Net to client
596 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> select * from (select * from t1 where rownum>0) where object_id>100000;
未選定行
執行計劃
----------------------------------------------------------
Plan hash value: 1843306320
-----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 74494 | 34M| 389 (1)| 00:00:01 |
|* 1 | VIEW | | 74494 | 34M| 389 (1)| 00:00:01 |
| 2 | COUNT | | | | | |
|* 3 | FILTER | | | | | |
| 4 | TABLE ACCESS FULL| T1 | 74494 | 34M| 389 (1)| 00:00:01 |
-----------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID">100000)
3 - filter(ROWNUM>0)
Note
-----
- dynamic statistics used: dynamic sampling (level=2)
統計信息
----------------------------------------------------------
8 recursive calls
17 db block gets
1605 consistent gets
0 physical reads
0 redo size
2168 bytes sent via SQL*Net to client
596 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL>