Subject | Re: [firebird-support] query performance problem |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2004-04-07T06:01:25Z |
On 6 Apr 2004 at 18:30, Tobias Jenkner wrote:
These three indexes are superfluous. Drop them.
could decrease performance too.
SY, Dimitry Sibiryakov.
>ALTER TABLE ITEM ADD PRIMARY KEY (ID);^^^^^^^^^^^^^^^^^^^^^^^^
>
>ALTER TABLE ITEM ADD CONSTRAINT FK317B1319BBD FOREIGN KEY (JOB)
>REFERENCES JOB (ID);
>ALTER TABLE ITEM ADD CONSTRAINT FK317B132AFA43C6 FOREIGN KEY
>(INDEXCLASS) REFERENCES INDEX_CLASS (ID);
>ALTER TABLE ITEM ADD CONSTRAINT FK317B13C3E6B25E FOREIGN KEY
>(FINISHEDSTEP) REFERENCES STEP (ID);
>
>CREATE INDEX FK317B1319BBD ON ITEM (JOB);
>CREATE INDEX FK317B132AFA43C6 ON ITEM (INDEXCLASS);
>CREATE INDEX FK317B13C3E6B25E ON ITEM (FINISHEDSTEP);
These three indexes are superfluous. Drop them.
>CREATE INDEX FOO ON ITEM (JOB, FINISHEDSTEP);"Depending on number of possible FINISHEDSTEP values this index
could decrease performance too.
>i execute the following query on this table:Show us the query plan. To begin with...
>"select count(*), finishedStep from item where job=22 group by finishedStep"
SY, Dimitry Sibiryakov.