🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: performance

#815
From: Tiberiu Horvath
Date: Fri, 11 May 2007 04:51
67 lines
2657 bytes
Amazing !!!

droped to 1 second ...

Thank you very much !



Tiberiu


"Svein Erling Tysv�r" <svein.erling.tysvaer@kreftregisteret.no> wrote in 
message news:46439619$1@newsgroups.borland.com...
> OK, I'll guess - try to remove the use of the id_gestuine index like this 
> (assuming that is the least selective index):
>
> select
>    sum(stoc_temporar.stoc) as stoc,
>    produse.denumire
> from produse
>   inner join stoc_temporar on (stoc_temporar.id_produs=produse.id_produs)
> where
>    produse.id_sortiment=3 and
>    stoc_temporar.id_gestiune+0=1
> group by
>       produse.denumire
> order by
>       produse.denumire
>
> HTH,
> Set
>
> Tiberiu Horvath wrote:
>> I have the following query, that takes 6..8 seconds on a large (4000 
>> records in stoc_temporar) database. Is there a way to speed up this ?
>>
>>
>> Thank you in advance,
>>
>> Tiberiu
>>
>>
>> select
>>    sum(stoc_temporar.stoc) as stoc,
>>    produse.denumire
>> from produse
>>   inner join stoc_temporar on (stoc_temporar.id_produs=produse.id_produs)
>> where
>>    produse.id_sortiment=3 and
>>    stoc_temporar.id_gestiune=1
>> group by
>>       produse.denumire
>> order by
>>       produse.denumire
>>
>>
>> PLAN JOIN (PRODUSE ORDER DENUMIRE_IDX INDEX 
>> (FK_PRODUSE_REFERENCE_SORTIMEN), STOC_TEMPORAR INDEX 
>> (FK_STOC_TEM_REFERENCE_PRODUSE, FK_STOC_TEM_REFERENCE_GESTIUNE)):
>> PLAN JOIN (PRODUSE ORDER DENUMIRE_IDX INDEX 
>> (FK_PRODUSE_REFERENCE_SORTIMEN), STOC_TEMPORAR INDEX 
>> (FK_STOC_TEM_REFERENCE_PRODUSE, FK_STOC_TEM_REFERENCE_GESTIUNE))
>>
>> Adapted plan:
>> PLAN JOIN (PRODUSE ORDER DENUMIRE_IDX INDEX 
>> (FK_PRODUSE_REFERENCE_SORTIMEN), STOC_TEMPORAR INDEX 
>> (FK_STOC_TEM_REFERENCE_PRODUSE, FK_STOC_TEM_REFERENCE_GESTIUNE)) 
Technical Details
Message-ID: <4643f647$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <464355cc@newsgroups.borland.com> <46439619$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,65a795d106dce3a2
X-Google-Attributes: gid114a0e,public
X-Google-Language: ENGLISH,ASCII
From: "Tiberiu Horvath" <exact@exactonly.ro>
Newsgroups: borland.public.interbase.sql
References: <464355cc@newsgroups.borland.com> <46439619$1@newsgroups.borland.com>
Subject: Re: performance 
Date: Fri, 11 May 2007 07:51:21 +0300
Lines: 69
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 86.122.211.180
Message-ID: <4643f647$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1178859079 86.122.211.180 (10 May 2007 21:51:19 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail