Subject | Re: [ib-support] IBServer too slow wiht 600.000 record |
---|---|
Author | lester@lsces.co.uk |
Post date | 2001-12-13T13:50:10Z |
> Hi, I am using latest version of firebird. I created a procedure in order toHave you tried -
> calculate max, min, average stock prices of selected firms. I have 333
> different stock code and approximately 600.000 daily records. in my
> procedure, I am first selecting the code, then I am searching this code in
> the main database, select * from ... where ....code=:code_var
> then updating the table that contains unique stock codes and fields for max,
> min and average prices. it calculates, but too slwo, approximatly 1/2 hour.
> is this possible or there is a fallacy with me.
SELECT MAX(PRICE), MIN(PRICE), SUM(PRICE), COUNT(PRICE)
FROM XXX
WHERE CODE=:CODE_VAR
GROUP BY STOCKCODE
Have you got an index on STOCKCODE and on PRICE
( I think there is an AVR, but may be getting confused with
FastReport )
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services