This is just a short note on the parameter introduced in the 11gR2 called _connect_by_use_union_all. I’ve noticed it for the first time in Doc ID 7210630.8, which gives a brief overview of the changes made to the way CBO generates plans for hierarchical queries. As usually happens, the change helps to one problem, but produces a bunch of unexpected side effects, such as wrong or incorrect results, and even ORA-00904 in a simple case. All these bugs have been fixed in the 11.2.0.2 patch set, but who knows how many issues related to the change are still there? If you see something unusual with a standard Oracle hierarchical query in the 11gR2, I think it’s good to try turning this parameter off and see if it helps.
-
Categories
-
Tags
10.2.0.3 10.2.0.4 10.2.0.5 10g 10gR2 11.2.0.1 11.2.0.2 11.2.0.3 11g 11gR2 ANSI SQL ASH AWR benchmark bind peeking bug bug-or-feature CBQT coalesce coalesce subquery collections conferences connect by control files docs dynamic views EBR Exadata fail FBI Firefox full join funny stuff Hotsos indexes iPX ITL javelin JNI join elimination join factorization memory merge MOS muxers nested loops OIC OICA OOM optimizer_features_enable opt_param ORA-04031 Oracle JVM outer join PDML poll presentations PX RAC scripts shared cursors SPECjAppServer2004 sql_trace statistics Statspack subqueries subquery factoring subquery unnesting Sun Tom Kyte tpt trace files undocumented wait events wish list -
Top Posts
-
Blogroll
-
Join 529 other subscribers
10 Comments
Wow! Good catch, Timur!
Hi Noons,
yeah, it’s so gooood to catch (and kill) a bug or two 🙂
A small update: it looks like the value you would want to try for this parameter in case of a problem is “old_plan_mode” rather than “false”. And here is a new bug 10218578 related to the parameter; claimed to be fixed in 12.1.
Another update: it looks like this new feature allows Oracle to do “magic” things with CONNECT BY queries that build hierarchy over a join. The documentation states
But look at this plan which is built on a 11.2.0.2 with a query that has two joins in a CONNECT BY query block:
One more bug associated with this parameter introduced in 11.2.0.3: Bug 13117043 – ORA-600 [13009] Raised for SELECT FOR UPDATE on Hierarchical Query.
And one more for 11.2.0.1, 11.2.0.2 – Bug 9906422 – ORA-600 [qctVCO:csform] from query using WITH, CONNECT BY and CLOBs / ORA-979 with CONNECT BY and SUBSTR [ID 9906422.8]
This may noticed in simple query on the GV$SQL_PLAN table with parameter _connect_by_use_union_all = TRUE (without any WITH, CLOBs and SUBSTR usage):
Hi Igor
thanks for that. I tried the query on one of 11.2.0.2.0 and it works OK for me.
Possible platform specific:
I have the same platform. Do you have fixed objects stats in place (I don’t)? Maybe some other optimizer related parameters? Here are plans with two possible modes:
Without the fixed object stats too, and here is plan with _connect_by_use_union_all = FALSE | OLD_PLAN_MODE: