🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

performance

#810
From: Tiberiu Horvath
Date: Thu, 10 May 2007 17:26
35 lines
1870 bytes
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: <464355cc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,65a795d106dce3a2,start
X-Google-Attributes: gid114a0e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Tiberiu Horvath" <exact@exactonly.ro>
Newsgroups: borland.public.interbase.sql
Subject: performance 
Date: Thu, 10 May 2007 20:26:36 +0300
Lines: 38
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; Original
NNTP-Posting-Host: 86.122.211.180
Message-ID: <464355cc@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1178817996 86.122.211.180 (10 May 2007 10:26:36 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail