MSSQL stored procedure with sybase linked server getting recompiled for each execution -
i have stored procedure in ms sql server uses sybase linked server. each time stored procedure executed runs long time , looks recompiling before execution. idea how stop recompilation?
its hard believe recompilation taking time. suspects procedure using old plan execute not optimized.
few points check.
- excute recompile option. make new query plan.
- check query inside proc taking long time. if mda tables installed check in mossysstatement. or check in master..sysprocesses table while running stored proc. show statement number running. give fair idea statement taking.
- run update statistics on tables used stored proc.
thanks, gopal
Comments
Post a Comment