Article View: borland.public.interbase.sql
Article #287Re: Store Procedure and IN
From: Karol Bieniaszewski
Date: Thu, 21 Feb 2008 09:40
Date: Thu, 21 Feb 2008 09:40
73 lines
2943 bytes
2943 bytes
or separate query bettween or and do union Karol Bieniaszewski U�ytkownik "Karol Bieniaszewski" <liviuslivius@poczta.onet.pl> napisa� w wiadomo�ci news:47bd4554@newsgroups.borland.com... > then try exists clause > > Select * > From MyStoreProcedure MSP > Where MSP.foo1 = MSP.foo2 > and MSP.foo3 = MSP.foo4 > and MSP.foo5 = MSP.foo6 > or exists(SELECT * FROM MyTable MT where MT.ID=MSP.ID AND MT.f1=MT.f2) > > Karol Bieniaszewski > > > > U�ytkownik "Safwan" <safwan_maswadeh@yahoo.com> napisa� w wiadomo�ci > news:47bd3ecc$1@newsgroups.borland.com... >> 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:
<47bd4591$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!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> <47bd3ecc$1@newsgroups.borland.com> <47bd4554@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> <47bd39ef$1@newsgroups.borland.com> <47bd3ecc$1@newsgroups.borland.com> <47bd4554@newsgroups.borland.com> Subject: Re: Store Procedure and IN Date: Thu, 21 Feb 2008 10:40:20 +0100 Lines: 75 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: <47bd4591$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1203586449 195.205.151.58 (21 Feb 2008 01:34:09 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail