Subject Re: Plan question, what is a stream and what isn't?
Author
> ---In firebird-support@yahoogroups.com, <tdw@...> wrote :
>
> If SET STATISTICS is done on one connection, when does it take effect?

  As any DDL statement it actually runs at transaction commit.

> What about a transaction that was already running at the time someone
> else did SET STATISTICS, does that use the new statistics for any new
> statements it runs (where all the code running is in stored procedures)?
>
> What about a connection that was already in existence at the time
> someone else did SET STATISTICS, does that use the new statistics for
> any new transactions it runs (where all the code running is in stored
> procedures)?

  Think in terms of statements, not transactions\connections. When statement
is prepared optimizer used most recent statistics to create execution plan.
Note, stored procedures and triggers are prepared\optimized once when
loaded into metadata cache.

Regards,
Vlad