Subject IB - PLAN clause in the SELECT
Author Alan Candido
Gentlemen,

Sorry, but my english is bad.

In select

select TEMPO.DT_EVENTO as DT_EVENTO,A1.COD as CLIENTE,b1.COD as PRODUTO ,SUM
( D2.QUANT ) as QUANT,SUM ( D2.TOTAL ) as TOTAL
from D2 ,TEMPO,A1,B1
where TEMPO.DT_EVENTO = D2.EMISSAO
and A1.COD = D2.CLIENTE
and B1.COD = D2.COD
group by TEMPO.DT_EVENTO,A1.COD,B1.COD
PLAN SORT (JOIN (D2 INDEX (D2_03), B1 INDEX (RDB$PRIMARY2),TEMPO INDEX
(RDB$PRIMARY4),A1 INDEX (RDB$PRIMARY1)))


I placed " plan clause" but I get the error " Index D2_03 cannot be used in
the specified plan ". The D2_03 index belongs the table that this being
specified (D2) and is composite of field D2.Emissao. The " plan " presented
in the IBConsole is " PLAN SORT (JOIN (D2 NATURAL, B1 INDEX (RDB$PRIMARY2),
tempo INDEX ", but I believe that to obtain itself to force I will have
performance profit. I have about 2,200,000 in the table D2, 15.000 in B1
and 9.000 in A1.

I look for information on tunning for performance profit.

Some ideia or suggestion to gain performance.

Grateful

Alan Candido ><>





[Non-text portions of this message have been removed]