Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Help with view, pushing predicate, and 9i
Hi,
We have a view which is usually accessed like: select * from vu_xan_comp_agrmt_single where doc_id =3D :some_doc_id;
In 8i (8.1.7.4 on Solaris 8), the 'doc_id=3D ' predicate is pushed into the view, and it works fine.
We are in the process of converting this app to 9i (9.2.0.5 on Solaris 8), and in 9i, the predicate is not pushed. This results in a full table scan on a large table, and, abysmal performance.
This should NOT be a case where the predicate can't be pushed, due to rownum or analytical or aggregate function, etc. It works in 8i, so why not in 9i? Is this an optimizer bug? (_push_join_union_view and _push_join_predicate are both TRUE.)
Any thoughts or suggestions are welcome.
Thanks,
-Mark
PS Here's the beastie:
CREATE OR REPLACE FORCE VIEW ADDS.VU_XAN_COMP_AGRMT_SINGLE
(DOC_ID, VLAD_ID, CPAG_TEXT, CPAG_TEXT_LENGTH, CPAG_DAY_EFFECTIVE,=20
CPAG_CALC_DATE, CPAG_FORMAT_MASK)
AS=20
select /*+ index(cpag cpag_indx_pr02) */ distinct doc_id, 0 vlad_id,
first_value(cpag_text) over (partition by doc_id
order by cpag_day_effective desc) cpag_text,
first_value(length(cpag_text)) over (partition by doc_id
order by cpag_day_effective desc) cpag_text_length,first_value(cpag_day_effective) over (partition by doc_id order by cpag_day_effective desc) cpag_day_effective, first_value(cpag_calc_date) over (partition by doc_id order by cpag_day_effective desc) cpag_calc_date, first_value(cpag_format_mask) over (partition by doc_id
order by cpag_day_effective desc) cpag_format_maskfrom compressed_agreements cpag
order by vlad_id,cpag_day_effective desc)cpag_text_length,
order by vlad_id,cpag_day_effective desc) cpag_day_effective, first_value(cpag_calc_date) over (partition by doc_id,vlad_id order by vlad_id,cpag_day_effective desc) cpag_calc_date, first_value(cpag_format_mask) over (partition by doc_id,vlad_id order by vlad_id,cpag_day_effective desc)cpag_format_mask
Mark J. Bobak
Oracle DBA
ProQuest Company
Ann Arbor, MI
"Post Hoc Ergo Propter Hoc"