Subject Re: Execute statement question
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, Alex Taylor <basswar@v...>
wrote:
> Hi All!
>
> Does an SP uses the optimizer if I use the EXECUTE STATEMENT in the
> procedure body?
> Does it use indices?

Alex, why not? EXECUTE STATEMENT is translated into BLR before
execution and after that performed as any pre-compiled query, but I'm
not shure it's execution details can be reported by tools using API.
Naturally you lose in performance as any interpreter lose to compiler.
Note if you use EXECUTE STATEMENT in the loop, it is translated each
time regardless was it changed or not. This feature is not for usage
instead of normal PSQL but is workaround for problems for which
another workarounds are more expensive.

Best regards,
Alexander.