Regressed queries in the sys.dm_db_tuning_recommendations view

The new SQL Server 2017 sys.dm_db_tuning_recommendations system dynamic management view returns detailed information about tuning recommendations for queries which execution details are captured by Query Store. To see this feature in action, you will repeat the scenario from the previous section, executing a query in two different compatibility levels, but this time you'll let SQL Server automatically identify the regression and suggest the fix.

Open your SSMS and turn on the Discard results after execution option. You need to choose the Query Options menu item, click on the Results node in the left pane tree view, and check the Discard results after execution checkbox. This option ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.