By default, when a query is executed in SQL Server, it compiles and generates an execution plan and stores it in the plan cache. If this is a one-off or ad-hoc query that will never be run again, then the newly generated plan is wasted and its space that is being used in the plan cache is also wasted. This means the buffer pool now contains compiled plan of queries that will never be executed.
The post Optimize for Ad Hoc Workload in SQL Server appeared first on SQLOPS.
]]>