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.
Author |
Topic |
kudzen
Starting Member
12 Posts |
Posted - 2012-05-29 : 08:16:58
|
Hi there guys,I'm trying to learn how plan reusing works and i run this query against my serverselect stats.execution_count AS exec_count, p.size_in_bytes as [size], [sql].[text] as [plan_text]from sys.dm_exec_cached_plans pouter apply sys.dm_exec_sql_text (p.plan_handle) sqljoin sys.dm_exec_query_stats stats ON stats.plan_handle = p.plan_handleAnd it returns the same query text multiple times with execution count =1I checked char by char if the full text is equal and it is.I really don't understand.Can you please help me figuring this out?SQL Text returned by the above statement:http://pastebin.com/index/iWE3ZtwNPS: This is a stored procedure ! |
|
kudzen
Starting Member
12 Posts |
Posted - 2012-05-29 : 12:12:40
|
I used perfmon to compare Batch Request/sec per Compilation/sec and this is how it seems[url]http://imageshack.us/photo/my-images/232/trace.gif/[/url]What's your opinion?To many ad-hoc queries? |
 |
|
|
|
|