Subject | Re: [Firebird-Architect] Stored Procedures, Index Statistics and Plans |
---|---|
Author | Martijn Tonies |
Post date | 2004-10-13T13:14:12Z |
Hello Ian,
procedure gets executed (or perhaps more precise, I'm not
entirely sure: when it gets loaded for the first time after there
were no connections to the database).
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> It is my understanding that when stored procedures are compiledNot correct. An execution plan is calculated each time the
> the execution plan for the sql statements within them are
> calculated.
procedure gets executed (or perhaps more precise, I'm not
entirely sure: when it gets loaded for the first time after there
were no connections to the database).
> When a database is created from script, the tables are typicallyNo, recompilation is not needed and entirely useless.
> empty when the stored procedures are created. At this time the
> statistics for all the indexes are the same (0).
>
> Does this mean that the optimal plan will never be selected until
> the both the index statistics are recalculated and the stored
> procedures are recompiled?
> If this is the case, is there any way to automatically re-compileNope, unless you have stored the script somewhere :-)
> all procedures (assuming the source exists!) perhaps using EXECUTE
> STATEMENT ...
> (This post was influenced by the threads debating the possibilityWith regards,
> of automatically recompiling stored procedures and triggers.)
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com