SQL Server 2016 CTP2 Query Data Store – Execution Plan Change Tracking

Hi Friends,

In my previous blog post, I had explained about SQL Server 2016 CTP2 Query Data Store feature Importance as well as how to enable it for our database.

Today I’ll show you the one important use of this feature. Tracking execution plans changes for a query execution. Query Data Stores the Execution plan changes for the query execution. You can see these details by clicking on Top Resource Consuming Queries under Query Store for your database.

Query Data Store Demo1

Now I’ll show you the multiple execution plans tracked by this feature. I am using AdventureWorksDW2014 database here. I have executed my test query 3 times:

First: When there was No Index on the both the Tables. Execution plan was tracked by Query Store and can be checked by clicking on Top Resource Consuming Queries as mention below. In the upper right side you can see that there are three circles. Red Highlighted circle is showing the execution plan for first execution. When you will click on that circle then it will show you that execution plan below (as shown by RED Line).

Query Data Store Demo2

Second: I have created the missing index recommended in the above execution plan and then again ran the query. Execution plan for this execution is shown below:

   

Query Data Store Demo3

Third: I have created the missing index recommended in the above execution plan and then again ran the query. Execution plan for this execution is shown below:

Query Data Store Demo4

Here you have seen the multiple execution plans for a single query. You can use this feature to track the execution plan changes (if any) after any upgrade or Service Pack Installation.

HAPPY LEARNING!

Regards:
Prince Kumar Rastogi

Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook

Follow Prince Rastogi on Twitter | Follow Prince Rastogi on FaceBook

   

About Prince Rastogi

Prince Rastogi is working as Database Administrator at Elephant Insurance, Richmond. He is having more than 8 years of experience and worked in ERP Domain, Wealth Management Domain. Currently he is working in Insurance domain. In the starting of his career he was working on SQL Server, Internet Information Server and Visual Source Safe. He is post graduate in Computer Science. Prince is ITIL certified professional. Prince likes to explore technical things for Database World and Writing Blogs. He is Technical Editor and Blogger at SQLServerGeeks.com. He is a regular speaker at DataPlatformDay events in Delhi NCR. He has also presented some in depth sessions about SQL Server in SQL Server Conferences in Bangalore.

View all posts by Prince Rastogi →

Leave a Reply

Your email address will not be published.