Subject | Re: [firebird-support] Optimizer tricks was Re: Count(id) returns null |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-09-07T19:03:08Z |
"Ann W. Harrison" <aharrison@...> wrote:
1) compile time (constant expressions)
2) execution start time (invariant expressions)
3) fetch time (everything else)
Perhaps (1) and (2) could be both defered to the execution time to simplify
the code.
P.S. Just think about various (including hand-made) SQL
constructors/generators.
Dmitry
>Yes. Moreover, there should be several levels of evaluation:
> Do you have specific examples? The case that started this was
> WHERE 1 = 0 - a condition that can be evaluated at compile time as
> false. Is it actually worth testing whether both sides of an
> equality can be evaluated at compile time and performing the
> evaluation?
1) compile time (constant expressions)
2) execution start time (invariant expressions)
3) fetch time (everything else)
Perhaps (1) and (2) could be both defered to the execution time to simplify
the code.
P.S. Just think about various (including hand-made) SQL
constructors/generators.
Dmitry