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)

Execution Plan, SQL Cache, SQL Memory, SQL Scripts, SQL Server
Previous Post
SQL SERVER – SQLOS Scheduler and the Process States
Next Post
SQL SERVER – TempDB Error: CREATE FILE encountered operating system error 3

Related Posts

3 Comments. Leave new

  • I do not understand this, what has statistics usage to do with the caption of this article?

  • I got a execution plan and saved it and restarted sql server services which clears the cached plan when i tried to use it in the existing execution plan by using OPTION(USE PLAN) and i did not get the performance which i gained. Is it possible to add the execution plan in to sql cache which can be reused when we used the same query.


Leave a Reply