sp_BlitzCache™ Result: Legacy Cardinality Estimator

SQL Server 2014 introduced a brand new cardinality estimator. Unfortunately, the old cardinality estimator is still present. Queries will use the legacy cardinality estimator when the database is in an old compatibility level (less than 120 for SQL Server 2014) or a trace flag is being used.

Using the old cardinality estimator can lead to poorly performing T-SQL, bad execution plans, missed estimates, and potentially excessive parallel queries.

To learn more about the new cardinality estimator, here’s a few of our posts:

How to Fix the Problem

Verify that all databases are in the current compatibility level. If a database is in a legacy compatibility level, make sure that there’s a really good reason for it.

If all databases are in the current compatibility level, you’ll need to check for queries using trace flags to force SQL Server to use the legacy query optimizer.

Use the following query to find execution plans using a legacy cardinality estimator.