In the previous article, I have shared basic theory about the SQL Server Latches.
In this post, I am sharing T-SQL script to find different information and usage statistics of the SQL Server Latches.
Using this dynamic management function, you can find information about the Locks and Latches.
You can pass different parameters like: DatabaseID, TableID, IndexID, and PartitionNumber.
Database identifier | DEFAULT | 0 | NULL
,Object identifier | DEFAULT | 0 | NULL
,Index identifier | DEFAULT | -1 | 0 | NULL
,Partition number | DEFAULT | 0 | NULL
FROM sys.dm_db_index_operational_stats (DB_ID(), NULL, NULL, NULL)
Using this dynamic management view, you can find different Latches counter information.
Using below DBCC, You can clear this view data for latest updated stats.
DBCC SQLPERF('sys.dm_os_latch_stats', CLEAR)
SELECT buffer related information.
SELECT * FROM sys.dm_os_latch_stats WHERE latch_class = 'buffer'
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.