Capturing plan info

For each query, you can have at least one execution plan. Therefore, in the plan repository, at least one entry exists for each query from the query repository. The following query returns rows from the plan repository:

SELECT * FROM sys.query_store_plan; 

You can see four plans for four executed queries in the WideWorldImporters database. The first query is your initial query; the rest are queries against catalog views as shown in the following screenshot. As mentioned earlier in this section, you can see more entries if you execute the code examples from this chapter.

Check captured query plans in Query Store

The sys.query_store_plan ...

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.