I have a data warehouse database and I\'m facing problems with the new cardinality estimator of SQL Server 2014.
After upgrading the database server to SQL Server 2014 I
I think there is no simple answer today to this interesting question. The best answer I know is the following video: http://channel9.msdn.com/events/TechEd/NorthAmerica/2014/DBI-B331#fbid=. It has numerous examples of new and old estimators. The video is about 50+ mins long but it is worth the time.
A summary of the video that relates to this question:
Old assumptions of cardinality estimates:
To Use SQL SERVER 2012 cardinality estimator in SQL SERVER 2014 use the following option:
What is new estimator doing (based on video):
To do / checklist:
1. Auto Create / Update Stats
2. Check database compatibility mode (120/110)
3. Test using query trace flags
4. XML showplan
Update What's new in cardinality estimator (SQL Server 2016)
More details:
https://docs.microsoft.com/en-us/sql/relational-databases/performance/cardinality-estimation-sql-server
https://www.sqlshack.com/query-optimizer-changes-in-sql-server-2016-explained/