Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UNION ALL slow (cost goes from 75 and 173 to 450,789!)

761812Jun 14 2010 — edited Jun 14 2010
Hi,

I have two Selects (lots of joins - big tables)

Select A) has an explain plan cost of 75
Select B) has an explain plan cost of 173

If I union (or union all) the cost goes up to 450,789!

I can paste in the queries, plans etc - but if anyone has any quick ideas that'd be great.

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

What I'd like is to force the optomiser to run each query sequentially - but not really sure how.

Any help would be really appreciated - I have few hairs left and am just about to tear the last one out!

Cheers,
Patrick
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2010
Added on Jun 14 2010
6 comments
1,595 views