Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle SQL Condition Question...

Re: Oracle SQL Condition Question...

From: <gilles.cordier_at_usa.net>
Date: 1998/04/21
Message-ID: <6hhgsa$qg6$1@nnrp1.dejanews.com>#1/1

In article <6hg4p8$se0$1_at_engnews2.Eng.Sun.COM>,   gosar_at_EBB.Eng.Sun.COM wrote:
>
> Hi,
>
> I have 2 tables
>
> tab1 tab2
> ==== ====
> .. ..
> .. ..
> f1 f2
> .. ..
> .. ..
>
> Both the tables above contain approx. 60,000 Records
> and have indexes on f1 and f2.
>
> I have an SQL which is the foll..
>
> Insert into tab3 ( select * from tab1 where tab1.f1 not in
> (select distinct tab2.f2 from tab2));
>
> The problem is this SQL takes around 40-45 hours to execute...
>
> Am i missing something here...Or any Workarounds Possible...??
>
> TIA,
> Bg
>
>

Hi,

Have you tried to create an index on column f2 from tab2 ? I also suggest to remove the "distinct" clause. This will perhaps prevent Oracle to perform a "sort" operation.

Sincerely,

Gilles



Gilles CORDIER

System & Database Administrator
Villeneuve d'Ascq -- France


-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Tue Apr 21 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US