Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: tuning
Thanks Alan,
the effect is astonishing! From almost endless (I had to kill the session)
to 1 s! In this case there should not be any duplicates (actual orders and
old orders. An order can never be actual AND old.) so there is no problem
using the UNION ALL.
Thanks very much.
Corinna Becker
Alan D. Mills <alanmNOSPAM_at_uk.europe.mcd.mot.com> wrote in article
<6vvcml$jsf$1_at_schbbs.mot.com>...
> Using UNION there is an implied sort going on which is how the duplicates
> are removed. Maybe this is what is slowing down the query. Assuming
that
> the individual SELECTs produce distinct records then try a UNION ALL.
This
> doesnl;t remove duplicates and so may not perform the sort. I haven't
> proved this but worth a try.
>
> --
> Alan D. Mills
>
>
> Corinna Becker wrote in message
> <01bdf695$0b7c56e0$a049100a_at_pc743-sode.seurope.ikea.com>...
> >Hello,
> >I have the following statement:
> >
> >select 'A', t1.* from table1 t1
> >UNION
> >select 'B', t2.* from table2 t2;
> >
> >Each select statement is running ok, but together with the UNION it
takes
> >much too long. How can I tune something like this?
> >Thanks in advance
> >Corinna Becker
>
>
>
Received on Tue Oct 13 1998 - 07:39:17 CDT