Simple Predicate Pushing
- Simple Predicate Pushing은 Pushing 이 쉬운 Predicate을 의미
select /*+ gather_plan_statistics */
t1.c1, v.c2
from
t1,
(select t2.c1 as c1, t2.c2 as c2, t2.c3 as c3,
max(t3.c3) as max_key
from t2, t3
where t2.c1 = t3.c1
group by t2.c1, t2.c2, t2.c3
order by t2.c1, t2.c2) v
where
t1.c1 = v.c1 and
v.c3 = 1
;
Execution Plan
--------------------------------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=13 Card=10 Bytes=400)
1 0 HASH JOIN (Cost=13 Card=10 Bytes=400)
2 1 VIEW (Cost=7 Card=10 Bytes=270)
3 2 SORT (ORDER BY) (Cost=7 Card=10 Bytes=640)
4 3 HASH (GROUP BY) (Cost=7 Card=10 Bytes=640)
5 4 HASH JOIN (Cost=6 Card=10 Bytes=640)
6 5 TABLE ACCESS (FULL) OF 'T2' (TABLE) (Cost=3 Card=10 Bytes=380)
7 5 TABLE ACCESS (FULL) OF 'T3' (TABLE) (Cost=2 Card=100 Bytes=3K)
8 1 INDEX (FAST FULL SCAN) OF 'T1_N1' (INDEX) (Cost=6 Card=10K Bytes=127K)
8 - ACCESS PREDICATES "T1"."C1"="V"."C1"
9 - ACCESS PREDICATES "T2"."C1"="T3"."C1"
7 - FILTER PREDICATES "T2"."C3"=1
- 2번 단계엇 View Operation으로 부터 View Merging이 실패한 것을 알 수 있음.
- 7번 단계에 View 밖에 있는 "T2"."C3"=1 조건이 Pushing 된 것을 알 수 있는데 이것을 Simple Predicate Pushing 이라함
- no_push_pred 힌트를 사용하여도 Predicate Pushing 이 작동한다.
- Simple Predicate Pushing은 no_push_pred 나 _pred_move_around parameter를 false로 변경하여도 동작함