Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
sane man wrote:
>
> Hi,
> I was under the impression that when we put a
> sql statement in a SP. the sql's query plan is
> decided when we create the procedure. This seems
> not to be the case. Can some explain to me when
> in SP does the query plan for the Query is
> decided in SP. Hopefully not when he query is
> executed.
Query plans for Stored Procedures are developed at compile, ie create,
time or when you UPDATE STATISTICS FOR PROCEDURE... The caveat is that
if the table structure has changed it will invalidate the query plan and
the first user to run the SP will reoptimize it (as if UPDATE STAT....
had been run). There are some esoteric circumstances that seem to defy
this logic and cause an error rather than an automatic recompile (I
think deleting a referenced table and recreating it does this for
example). In this case you will have to explicitely UPDATE STATISTICS
FOR PROCEDURE...
Art S. Kagel
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.