Recent days, in our organisation, we are facing with a strange issue.
Our SQL Server has enough memory(256 GB) and CPU cores. There is no memory pressure(outcome of dm_os_sys_memory is "Available physical memory is high").
Only problem is, the procedure stats sys.dm_exec_procedure_stats is getting cleared very often. Stats doesn't stay even for an hour.
The reason why we need the stats is, it is being collected on daily basis with the help of the DMV dm_exec_procedure_stats. And, our SQL Developers used to do optimization on stored procedures, and once it is done, to know the effectiveness of the tuning activity, a comparison is being done between the collected historical stats and the current one.
Since, the procedure stats is not staying on the cache, we are not able to set any benchmark.
Kindly suggest some solutions.
Version: Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Enterprise Edition: (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: )