Oracle Scratchpad

February 26, 2007

Subquery with OR

Filed under: CBO, Execution plans, Tuning — Jonathan Lewis @ 10:35 pm UTC Feb 26,2007

There are various reasons why Oracle is sometimes unable to unnest a subquery. Here’s one example of a fairly common problem:


select
	count(small_vc)
from
	t1
where
	t1.mod_15 > 10
and	(    t1.modded = 0
	  or exists (
		select	null
		from	t2
		where	t2.id = t1.id
		)
	)
;

(more…)

Blog at WordPress.com.