Stored procedure insights

  • Please refer some articles to help me find out some basic question regarding stored procedures...

    1. Why sql server keep optimizing stored procedure plan for first few runs?

    2. How long does a compiled plan for stored procedure stay in sql server?

    3. How does sql server know that the cached plan is not optimal enough when some new data is inserted in the table from which stored procedure does data fetching?

    4. In which system tables the compiled plan is written?

    Thanks in advance...

  • Here's a few places with some very insightful information. (and don't forget BOL, your no#1 source of info)

    How to Interact with SQL Server's Data and Procedure Cache (article)

    http://www.sql-server-performance.com/rd_data_cache.asp

    Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server 2005 (whitepaper)

    http://www.microsoft.com/technet/prodtechnol/sql/2005/recomp.mspx#EKAA

    These was just a few links that was handy atm, there are much more 'out there'.

    /Kenneth

  • that was a great article...

    thanks kenneth...

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

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