[firebase-br] Melhorar Select

Paulo Geloramo paulogeloramo em terra.com.br
Ter Fev 15 20:26:21 -03 2005


Saudações Pessoal,

Estou executando a instrução SQL abaixo em um
banco Firebird 1.5.2, mas esta demorando 7 segundos
para retornar o resultado, alguma sugestão para
melhorar este desempenho?

SELECT T.ID_PONTO, SUM(I.VENDA)
FROM CE_PONTO_ITEM I
JOIN PONTO T ON (I.ID_PONTO = T.ID_PONTO)
JOIN CE C ON (I.ID_CE = C.ID_CE)
WHERE C.TIPO = 'N'
GROUP BY T.ID_PONTO


IBExpert apresentou:

Plan
PLAN JOIN (T ORDER PK_PONTO,C INDEX (IN_TIPO),I INDEX (PK_CE_PONTO_ITEM))

Adapted Plan
PLAN JOIN (T ORDER PK_PONTO,C INDEX (IN_TIPO),I INDEX (PK_CE_PONTO_ITEM))

------ Performance info ------
Prepare time = 0ms
Execute time = 7s 906ms
Avg fetch time = 161,35 ms
Current memory = 1.344.184
Max memory = 1.517.480
Memory buffers = 2.048
Reads from disk to cache = 379.113
Writes from cache to disk = 0
Fetches from cache = 816.767

[]s
Paulo 





Mais detalhes sobre a lista de discussão lista