🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #284

Re: Store Procedure and IN

#284
From: Karol Bieniaszewski
Date: Thu, 21 Feb 2008 08:50
33 lines
1766 bytes
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: <47bd39ef$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeeder.dynfx.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47bcbe87@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: "Karol Bieniaszewski" <liviuslivius@poczta.onet.pl>
Newsgroups: borland.public.interbase.sql
References: <47bcbe87@newsgroups.borland.com>
Subject: Re: Store Procedure and IN
Date: Thu, 21 Feb 2008 09:50:43 +0100
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 195.205.151.58
Message-ID: <47bd39ef$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1203583471 195.205.151.58 (21 Feb 2008 00:44:31 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeeder.dynfx.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail