Subject Re: Firebird 2.1.x runs very slow on first query execution (very low CPU usage)
Author zlatko.ivankovic
--- In firebird-support@yahoogroups.com, "mdjorov" <mircata@...> wrote:
>
> I have a query:
>
> SELECT
> SERIAL_NUM.SN,
> PARTIDA_NAL.ELEMENT_ID,
> IN_EL.SIMPLE_ID,
> PARTIDA_NAL.IN_EL_ID
> FROM
> OPR INNER JOIN IN_EL ON (OPR.SKLAD_ID = :SKLAD AND IN_EL.OPR_ID = OPR.ID)
> INNER JOIN PARTIDA_NAL ON IN_EL.ID = PARTIDA_NAL.IN_EL_ID
> INNER JOIN SERIAL_NUM ON SERIAL_NUM.PARTIDA_EL_ID = PARTIDA_NAL.ELEMENT_ID
> WHERE
> PARTIDA_NAL.KOL > 0.00
> ORDER BY 3
>

> The results:
> 1 row is fetched and it takes 31 seconds for the first execution of this query.

Do you have index on field opr.sklad_id ?


regards,
Zlatko