Execution plan comparison

Refactoring and improving the performance of code is a regular occurrence in the working day of a developer. Being able to identify if a particular query refactoring has helped improve an execution plan can sometimes be difficult. To help us identify plan changes, SSMS 16.x and higher now offers the option to compare execution plans.

By saving the execution plan and the T-SQL of our initial query as a .sqlplan file, we can then run our redesigned query and compare the two plans. In the following screenshot we see how to initiate a plan comparison:

Activating a plan comparison session

Upon activation, we must choose ...

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.