> ---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


  • ... 'Martijn Tonies (Upscene Productions)' m.ton...@upscene.com [firebird-support]
    • ... Tim Ward t...@telensa.com [firebird-support]
      • ... Tim Ward t...@telensa.com [firebird-support]
      • ... hv...@users.sourceforge.net [firebird-support]
        • ... 'Carlos H. Cantu' lis...@warmboot.com.br [firebird-support]
          • ... hv...@users.sourceforge.net [firebird-support]
            • ... Tim Ward t...@telensa.com [firebird-support]
              • ... hv...@users.sourceforge.net [firebird-support]

Reply via email to