SQL SERVER – Is Query from Cache? Execution Plan Property

Recently I was asked by my client of Comprehensive Database Performance Health Check, is there any way to know if the executed query is from cache or not. Well, of course, there is an easy way to know this and that is Execution plan property. Let us learn about it today.

First, run any query with an execution plan. There are multiple ways to enable execution plans. I have previously blogged about it here: SQL SERVER – 3 Different Ways to Explore Actual Execution Plans.

SQL SERVER - Is Query from Cache? Execution Plan Property executionplanproperty-800x426

Now that you have enabled the execution plan, run the query. Once the query is run, right-click on the leftmost operator (if you have run the SELECT statement, it will be the SELECT operator) and go to properties. Now on the right side expand the section OptimizerStatsUsage. Under this section, you will see all the statistics used for that particular query.

SQL SERVER - Is Query from Cache? Execution Plan Property executionplanproperty1

 

SQL SERVER - Is Query from Cache? Execution Plan Property executionplanproperty3

I hope this helps you to further troubleshoot your queries which are giving you trouble with performance. Execution plan property is a very handy tool.

Here are my few recent videos and I would like to know what is your feedback about them. Do not forget to subscribe SQL in Sixty Seconds series. I hope you appreciate learning about the Last 5 SQL in Sixty Seconds Video.

If you have any questions, you can always reach out to me on Twitter.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

, , , ,
Previous Post
SQL SERVER – SQLOS Scheduler and the Process States

Related Posts

2 Comments. Leave new

Leave a Reply

Menu