Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Documentation on Query Recompilation for 2005

Author  Topic 

sqlU
Starting Member

4 Posts

Posted - 2009-02-26 : 19:13:36
(Hopefully this post is in the correct area)

I am looking for detailed documentation on Query Recompilation under 2005. I remember reading good explanation once for 2000. It was similar to the link below, but mentioned specific conditions involving temp tables, like the psuedo-example below:

- If procedure A calls child procedure B, and procedure B creates and drops a temp table, a recompile will occur...

Maybe I am brain dead today, but I am not finding what I need on google. If anyone could point me in the right direction, it would be greatly appreciated.

http://msdn.microsoft.com/en-us/library/aa902682.aspx

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-02-26 : 19:30:15
Give these a try:

http://www.google.com/search?hl=en&q=avoid+recompilation+in+sql+server+2005

The advice given in the SQL 2000 article still applies for SQL 2005, more or less. The only significant difference is that 2005 has some additional hints to prevent recompiles under certain conditions.

Greg Low did a presentation as the PASS 2008 summit on avoiding recompiles, you can find the deck and sample code here:

http://www.sqldownunder.com/Presentations/tabid/102/Default.aspx

Look for the "Materials" link. He has a ton of good information in his presentations and blog.

If you have a copy of Inside Microsoft SQL Server 2005 T-SQL Querying there's a chapter on query processing that digs into compilation too. Definitely a good book to get.
Go to Top of Page

sqlU
Starting Member

4 Posts

Posted - 2009-02-26 : 20:28:45
Excellent. Thank you!
Go to Top of Page
   

- Advertisement -