Article View: borland.public.interbase.sql
Article #812Re: performance
From: Quinn Wildman (CodeGear Develope...
Date: Thu, 10 May 2007 18:54
Date: Thu, 10 May 2007 18:54
45 lines
2265 bytes
2265 bytes
Can you provide us the plan that is getting used? You can do this in isql with set plan on, or in IBConsole in the Plan tab. 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)) > > > -- CREATE DOMAIN NEW_COMPANY AS CHAR(8) DEFAULT 'CODEGEAR' CHECK (VALUE <> 'BORLAND') NOT NULL;
Technical Details
Message-ID:
<46436a8e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<464355cc@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,65a795d106dce3a2 X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 10 May 2007 11:54:32 -0700 From: "Quinn Wildman (CodeGear Developer Support)" <qwildman@nospam.codegear.com> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: performance References: <464355cc@newsgroups.borland.com> In-Reply-To: <464355cc@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 10.143.19.108 Message-ID: <46436a8e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1178823310 10.143.19.108 (10 May 2007 11:55:10 -0700) Lines: 45 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail