SQL Server Check

Forced parameterization

This is one of many SQL Server checks performed by our free sp_Check tools.

Learn More About Our sp_check Tools

Checks Performed

ID
Check
735
forced parameterization enabled

What’s the issue?

Parameterization controls how SQL Server treats literal values in queries when generating execution plans. Under the default SIMPLE setting, SQL Server parameterizes only a narrow set of straightforward queries, leaving most queries with their literal values embedded in the plan cache. When FORCED parameterization is enabled at the database level, SQL Server aggressively replaces nearly all literal values in queries with parameters, producing a single cached plan that can be reused across many similar queries regardless of the specific values passed in.

Why is this a problem?

Forced parameterization is a significant change in query behavior and is not appropriate for every workload. While it can reduce plan cache bloat and CPU spent on compilation for applications that submit many near identical ad hoc queries, it can also cause serious performance problems when data distributions are skewed. A single plan generated for one set of parameter values may perform poorly for other values, a situation commonly called parameter sniffing.

Forced parameterization also interferes with certain query patterns including those that rely on literal value based filtering for indexed views, filtered indexes, or specific plan choices. When enabled without thorough testing, it can cause widespread query regressions that are difficult to diagnose because the root cause is a database level setting rather than any individual query.

What should you do about this?

Identify affected databases by querying sys.databases and checking the is_parameterization_forced column. For each one, review with application owners whether forced parameterization was enabled intentionally to address a specific compilation or plan cache issue, or whether it was turned on speculatively. If there is no clear justification and no documented validation of its impact, disable it using ALTER DATABASE [DatabaseName] SET PARAMETERIZATION SIMPLE;.

If forced parameterization is genuinely helpful for an ad hoc query heavy workload, keep it but monitor query performance carefully, watch for parameter sniffing symptoms, and consider using plan guides or the OPTION (RECOMPILE) hint for queries that suffer from a single reused plan. Document the decision either way so future reviews do not have to rediscover the reasoning.

Read more…

Common SQL Server Consulting Advice: Enabling Forced Parameterization | Darling Data

Type

Performance

Importance

Medium

sp_Checks