|
|
Question : Sybase Stored Procedure Performance
|
|
Hi, I have a stored procedure executing within 1 minute and now it takes more than 10 mins... This stored procedure contains conditional statements and i think this could be the cause for performance degradation since it will not use the query plan created during procedure compilation time. Is there any work around for this problem...?
Thanks in Advance. Chella
|
Answer : Sybase Stored Procedure Performance
|
|
> do user call this procedure with parameters that would require difference query plans ? > -yes
if your proc is not coded for completely seperate executions plans (ie. each statement will only have one query plan, no matter what parameters are passed), then you will need to: (a) recode the procedure so that each statement will only ever have 1 query plan (HARDEST OPTION) (b) always call the procedure with EXEC ... WITH RECOMPILE (c) recreate the procedure with CREATE PROC ... WITH RECOMPILE (EASIEST OPTION)
use method (b) to test is this is the issue first
|
|
|
|