19.08.2015 14:29, 'Mr. John' wrote:

> This time,adding condition this way WHERE FIEL1=:F1 AND FIEL2=:F2 AND
> * (FIEL3=:F3 OR **:F3 IS NULL) *  INTO .. DO ..
>
> is causing query to be much slower ...
>
> this WHERE FIEL1=:F1 AND FIEL2=:F2 AND * (FIEL3=:F3 **) *  INTO .. DO ..
> takes *0.563s*

because all three index segments are used for the retrieval.

> but this takes *29.141s*
> WHERE FIEL1=:F1 AND FIEL2=:F2 AND * (FIEL3=:F3 OR **:F3 IS NULL) *  INTO
> .. DO ..

because (FIEL3=:F3 OR :F3 IS NULL) prevents the third index segment from 
being used, so only first two index segments are used for the retrieval.

This is absolutely expected.


Dmitry


Reply via email to