Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: union problem
kazelot_at_thenut.eti.pg.gda.pl wrote:
> I have two sql queries joined with union.
> Each query separately executes in about 0.1s.
> query1 union query2 takes more then 50s, which is about 500 times more.
>
> Is it possible? I mean it is because I got this results :-), but what what
> could happend?
>
> Thanks for any suggestions,
> kazelot
UNION adds an additional step. One that looks for duplicates in the two query results. If you know that the two queries will return different result sets, or if you don't care about duplicates, use UNION ALL.
Daniel A. Morgan Received on Tue Jun 12 2001 - 14:36:41 CDT