We have noticed an odd issue on two servers in a 3 node SQL Server 2017 cluster running Always On Availability Groups.
When checking the DMV sys.dm_os_performance_counters
the row counts are totally out showing 4billion+ rows. It's just a single instance, a very heavy utilised server but only the one.
It does seem to correct itself after a reboot.
This can cause bad plans if we join this DMV with others. The original code was from SQLWatch and it was running a union all against the DMV which caused a large mem grant. It was also joining the data to internal SQLWatch tables. We got around the issue by dumping the dmv data into a temp table and querying that instead.
Has anyone else experienced this?
The code I am running is:
SELECT * FROM sys.dm_os_performance_counters