Forced parameterization

What reasons would you not choose to force parameterization over simple parameterization for special queries in SQL Server?

Is there any performance overhead? If it would not be offset by (possible) winnings resulting from the reuse of query plans?

+3
source share
1 answer

Have you analyzed your plan cache to find out if you have a large number of one-time plans?

SELECT usecounts, COUNT(*), SUM(size_in_bytes) 
  FROM sys.dm_exec_cached_plans
  GROUP BY usecounts
  ORDER BY usecounts;

optimize for ad hoc workloads, , , , ? , .

SQL, , . , , ( , , , ). , , DBCC FREEPROCCACHE , , . (, , " ad hoc" , , , , , ).

, , (. " " ).

+5

All Articles