Subject Re[2]: [Firebird-Architect] ORs in Where statement
Author Daniel Rail
Hello Jim,

Thursday, June 12, 2003, 7:14:04 PM, you wrote:

JS> At 06:30 PM 6/12/03 -0300, Daniel Rail wrote:
>>This has been implemented in FB 1.5. And, you even have the option to
>>turn back on the complete boolean evaluation, if you wish. By default,
>>it's turned off.

JS> Having just checked the code, I fear you are correct. That's not the
JS> way I wrote it and not the way it should work.

JS> Why is it an option in version 1.5? Why would anyone want or care
JS> about full evaluation? (Other than wanting it to go fast, of course.)

As I remember the discussion, the configuration was added to keep the
old behavior for those who wanted it. And obviously, this behavior
wasn't implemented by you, but by someone else, after the code had
left your hands. Someone(don't recall who) on the Firebird team picked
it up and made the necessary changes. This person also thought that
because there was this odd behavior before and wasn't sure out
cancelling it would affect current queries, that it would be wise to have a
config param to reactivate it, just in case.

I just did some digging in Delphi's help on the subject, since it has
the option to compile with complete boolean or short-circuit
evaluations. Here's the difference and why someone would use one
instead of the other:
- Short-circuit evaluation is usually preferable because it guarantees
minimum execution time and, in most cases, minimum code size.
- Complete evaluation is sometimes convenient when one operand is a
function with side effects that alter the execution of the program

But, I do agree, that the config param shouldn't exist and only the
short-circuit evaluation should be used.

--
Best regards,
Daniel Rail