Subject Re: [firebird-support] Re: Count(id) returns null. although count should never return null...
Author Ann W. Harrison
Adam wrote:
> Just an aside, and a possible gotcha, the condition you use is not
> very efficient in Firebird
> WHERE 1=0
> will be evaluated for every record in the table (in Firebird 1.5.2,
> not sure about later versions).
> Hopefully some time in the future Firebird will be optimised to
> improve this, but till then, this works a treat.

That's actually an interesting question. Academic optimizers are full
of little tricks to catch idiotic queries and make them fast, with no
benefit to queries that a reasonable programmer would ever write.
Should we go that way? How much code - and execution time - should we
devote that effort?