Article View: borland.public.interbase.sql
Article #285Re: Store Procedure and IN
From: Safwan
Date: Thu, 21 Feb 2008 09:05
Date: Thu, 21 Feb 2008 09:05
46 lines
2137 bytes
2137 bytes
Thanks Karol Bieniaszewski But I use OR, so inner join will not give me the wanted result. .... or ID in (Select ID From MyTable Where f1 = f2); "Karol Bieniaszewski" <liviuslivius@poczta.onet.pl> wrote in message news:47bd39ef$1@newsgroups.borland.com... > > U�ytkownik "Safwan" <safwan_maswadeh@yahoo.com> napisa� w wiadomo�ci > news:47bcbe87@newsgroups.borland.com... >> Hi >> >> Select * >> From MyView >> Where foo1 = foo2 >> and foo3 = foo4 >> and foo5 = foo6 >> or ID in (Select ID From MyTable Where f1 = f2); >> >> With the above statement the speed is acceptable. But when changeing the >> same view (MyView) into a store procedure with - for select .... from >> ... do suspend. - like this : >> >> Select * >> From MyStoreProcedure >> Where foo1 = foo2 >> and foo3 = foo4 >> and foo5 = foo6 >> or ID in (Select ID From MyTable Where f1 = f2); >> >> The statement take a looooong time to fetch the records. >> I use the PLANalyzer to check the statement, I notice that the in clause >> cause slow. >> >> What should I do to speed up my query ?? >> > change in (select .. > to inner join > > Karol Bieniaszewski > >
Technical Details
Message-ID:
<47bd3ecc$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<47bcbe87@newsgroups.borland.com> <47bd39ef$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,5e0810130fee05d6 X-Google-Attributes: gid114a0e,public,usenet X-Google-Language: ENGLISH,ASCII From: "Safwan" <safwan_maswadeh@yahoo.com> Newsgroups: borland.public.interbase.sql References: <47bcbe87@newsgroups.borland.com> <47bd39ef$1@newsgroups.borland.com> Subject: Re: Store Procedure and IN Date: Thu, 21 Feb 2008 11:05:26 +0200 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 213.6.65.84 Message-ID: <47bd3ecc$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1203584716 213.6.65.84 (21 Feb 2008 01:05:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail