How to use dynamic management

Sometimes it's hard to combine system objects, especially dynamic management, together. No simple and unified instructions exist for it, but the next example shows a way of thinking about system queries.

One of the performance issues can be too frequent recompilations of execution plans. We want to have an overview of plan cache content. We want to know which plans are cached and how they are reused. The most simple information is provided by the sys.dm_exec_cached_plans view. Let's execute the following script:

select * from sys.dm_exec_cached_plans

We will see the following result:

Such a result is full of almost ...

Get SQL Server 2017 Administrator'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.