Execution plan of Stored Procedures

  • Hi,

    Is there any wat to ensure that an SP's execution plan is actually stored in buffer ? Is there any way to view the same?

    The SP is not defined with 'Recompile' option.

     

    Regards,

    Kaushik

  • Kaushik,

    Are you trying to look at what stored procs are available in the cache buffers?

    Not sure if you're trying to look for this

    select * from master..syscacheobjects

    Simon

    Simon Liew
    Microsoft Certified Master: SQL Server 2008

  • On a busy system, if it's a batch proc, wait 5 minutes after it's done, and it won't be cached any more.

    On a busy system, if it's a GUI proc, wait until about 2-5 new rows are added to the table and it will have to recompile.

    See Books Online for additional details...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Note it may be there but may still have to recompile. To see if it is using a cached version you really have to use Profiler and look for Cache Misses to see if it has to recompile itself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply