Quote:
>For the clarity (hopefully !), assume the following:
>1 a PowerBuilder application is executing a stored procedure
>2 there is no procedure cache
Then the procedure won't run. I don't understand what this is meant
to simplify.
Quote:
>3 physical objects such as columns and indexes are
> not being added or deleted
>4 the data distribution will change dramatically
>5 the stored procedure uses variables, and their range of values
> can change dramatically from 1 execution to another
>6 no re-compile options being used
>Q - Does SYBASE determine what the access path is when the DBA
> compiles the stored procedure, and it remains that way until
> the DBA physically re-compiles it again?
> OR
> Can SYBASE dynamically ( at execution time ) determine what
> access path to use?
If by access path you mean the order in which the tables are accessed and
which indexes are used (what Sybase calls the query plan), this is stored
in procedure cache when the SP is first executed and stays there until it is
flushed out of procedure cache by being least-recently-used.
Additional, possibly different query plans can be generated and loaded
into memory by executing the SP WITH RECOMPILE, or if two users try to run
the SP at the same time. But once a query plan is in memory it doesn't change,
even if it is grossly inappropriate for some later execution.
Did I understand the question?
--
| Peter A. Lynn | "The only thing necessary for the triumph of evil |
| My opinions are my own, and may not reflect those of my employer (or |
| anyone else, for that matter.) I reserve the right to change my mind. |