On Feb 5, 3:05 pm, b...@[EMAIL PROTECTED]
wrote:
> On Feb 5, 1:33 pm, jefftyzzer <jefftyz...@[EMAIL PROTECTED]
> wrote:
>
>
>
> > Friends:
>
> > In Sybase 12.5.3, is the SQL within a stored procedure precompiled and
> > the query plan stored somewhere (e.g., a package a la DB2 and/or in
> > the data dictionary)? I'm speaking just of static SQL, BTW.
>
> > Basically, I'm wondering if, by default, Sybase reoptimizes a
> > procedure the first time it's called. Usually one of the benefits if
> > SPs (beyond encapsulation) is that the SQL has already been parsed and
> > an execution plan determined.
>
> > Is this where abstract plans come in?
>
> > Thanks,
>
> > --Jeff
>
> When you create a procedure, the TSQL source code is parsed and
> normalized into a query tree structure, which is stored in
> sysprocedures. The query tree specifies what data is to be retrieved
> from which objects, but not how that is to be done. When a procedure
> is called and there is no available query plan in the procedure cache
> (as would be the case the first time a proc was called after being
> created, a reboot, or a load of a dump, or if all cached plans were
> currently in use), ASE p***** the query tree to the optimizer, which
> compiles a new query plan which is stored in procedure cache and then
> executed.
>
> The term "compile" in ASE means to generate a query plan from a query
> tree.
Thank you, Bret. This answers my question completely.
--Jeff


|