Subject RE: [firebird-support] Simple query takes too much time
Author Leyne, Sean
Jorge:

> Using MSAccess, a single query to this table takes an average of 14 ms.

You think *14ms* is slow?!?!?!?


> SELECT "GTIN" ,"ACTIVO" FROM "TRAZABILIDAD_MEDICAMENTOS" WHERE
> ("GTIN"
> = ?)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ^^^^^^^^^^^^^^^^^^^^^
> PLAN (TRAZABILIDAD_MEDICAMENTOS INDEX
> (PK_TRAZABILIDAD_MEDICAMENTOS))
>
> param0 = bigint, "7795312000796"

Since you are using MS Access your query has not been prepared (ie. compiled), which is likely where most of the "query" time is going to.

The engine must prepare statement for execution. Some tools/language allow for statements to be prepared once and then executed with the necessary parameters, which is a significantly faster access pattern when you are executing the same query over and over again.


Sean