October 16, 2019 at 11:57 am
Hello
I am having an issue with the query stats dmv
If I run a statement or execute an SP I would expect it to generate a row in sys.dm_exec_query_stats
Sometimes it does but more often than not it doesn't
I'm also finding that when it does, if I query sys.dm_exec_query_stats a couple of minutes later, the row has disappeared
It's on my laptop and there are no jobs running (SQL Agent is currently disabled)
Any ideas what could be causing this?
It's almost like something i clearing it every few seconds
Thanks
- Damian
October 16, 2019 at 2:17 pm
Thanks for the response
It's developers edition and AutoClose is set to False
- Damian
October 16, 2019 at 2:29 pm
have you set your max server memory to a low threshold, so it ends up clearing the procedure cache?
Lowell
October 16, 2019 at 2:46 pm
Another options is a big query with huge execution plan which pushes other plans away from proc cache.
I saw similar issue with single exec plan 400MB+ in size.
Enable QueryStore on your DB and you will get all your DML queries and plans there.
Btw, i have created 4 dashboards (for SSMS) which visualize QueryStore content and let see what and when was run, how many times and resources consumed.
They are available here and main report is QueryStore_Overview.
October 16, 2019 at 3:09 pm
btw, you can check procedure cache using the following query:
select objtype [objtype]
, cacheobjtype
, sum(1) [plans]
, convert(numeric(10,1),sum(size_in_bytes/1024.)/1024.) [TotalSizeMB]
, max(size_in_bytes)/1024/1024 [LargestPlan_MB]
from sys.dm_exec_cached_plans
group by objtype, cacheobjtype
order by 4 desc
option (recompile)
October 17, 2019 at 8:06 am
Thanks for your suggestions
I tried a few and it didn't work although useful to know
I'll also take a look at your Query Store SSRS reports @Audrey
I eventually found a resolution here:
https://sqltechblog.com/2016/12/08/what-keeps-clearing-my-query-stats/
It seems to be related to lock pages
I've amended this and now start SQL Server as Local System
That seems to have resolved it
Thanks
- Damian
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply