Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: union problem
Hi Kazelot,
It sure is possible, as you have found!
A "union" takes the results of each of the two constituent queries and then sorts them so that it does not return duplicates (i.e. if the same result row exists in each result set, the union will return only one).
If you don't require this filtering of duplicates, use a "union all" instead (eliminates the nasty old sort). If the filter is necessary, have a look at where the sort is occurring. If it is happening on disk (i.e. in temp space), you could perhaps consider increasing sort_area_size to accommodate the sort in memory (much quicker than disk sorts).
Hope this helps,
Dave.
<kazelot_at_thenut.eti.pg.gda.pl> wrote in message news:<Pine.LNX.4.33.0106121216580.13915-100000_at_thenut.eti.pg.gda.pl>...
> 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
Received on Tue Jun 12 2001 - 16:36:20 CDT
![]() |
![]() |