Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Ora 9.2 SQL: What's the fastest way to do this set operation...
While I think Brian is correct (as usual), and I'm too lazy to think
about this in detail (as usual), I think you might benefit from
examining explain plans and checking out
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:62364503028143
. I suspect the distincts are forcing a lot of unnecessary sorts and
opine that playing around with rownum positioning controlling the
various selects, watching the effect on plans, might allow the
intersect pruning you desire. If you can get there, that might be
better than PL. Also, I'm unsure if rownum can short-circuit the sort
in having/group by, but if so that might be a way to get "at least
one."
jg
-- @home.com is bogus. http://www.spectrum.ieee.org/mar06/3069/1Received on Mon May 01 2006 - 16:44:39 CDT