Subject Re: [firebird-support] 2.1.2 uses a less optimised execution path
Author Dmitry Yemanov
Huan Ruan wrote:
>
>> I'm comparing LI-V6.3.2.18118 Firebird 2.1 vs LI-V6.3.1.12855 Firebird 2.0.

Interesting. The only reason of the issue you mention would be different
compiler versions. Unfortunately, I don't remember what GCC versions are
used to build both these FB releases.

>> Thanks for running the script, Dmitry. But I just ran it again to be sure,
>> still the result is 6 index reads on ExcludedFile with v2.1.2 but 2 index
>> reads with v2.0.3.

I was testing on Windows, this somewhat confirms my guess stated above.

A short answer is that there's no predefined evaluation order for
predicates in Firebird. In fact, this depends on the compiler used to
build the FB binaries. So what you observe is not really a bug, but
rather a side effect of some implementation detail. It's going to be
fixed in v2.5 though, at least to work similarly in all environments,
i.e. always from left to right (no promises for the smart re-ordering of
predicates yet).


Dmitry