Hi All,
If I run the below query on my SQL 2008 server I get a result of: 2621440
SELECT cntr_value
FROM sys.dm_os_performance_counters
WHERE RTRIM([object_name]) LIKE '%Buffer Manager'
AND counter_name = 'Total Pages';
If I run the below query I get an result of: 336241
SELECT
COUNT(1)
FROM sys.dm_os_buffer_descriptors
I would have expected these values to be the same, I am guessing that I am not understanding something correctly if anyone could explain the reason for this I would be grateful. The reason I am asking this question is I am trying to determine which database is using the buffer pool by running the below query
SELECT
database_id
COUNT(1) AS [PageCount]
FROM sys.dm_os_buffer_descriptors
GROUP BY
database_id
And I expected the total pagecount = cntr_value in the first query.
Many Thanks
Phil