Sql-server – Sp_BlitzWho can get blocked…

sp-blitzsql servert-sqlwait-types

I was playing around with sp_BlitzWho and got blocked by another session. The session was from the DB were sp_BlitzWho is… I was planning to automate it and save the results to a table, so I could analyze the accumulated wait stats for different sessions (I have heard it does that in contrast to sp_WhoIsActive), but now it seems not to be such a good idea… Maybe it is better to just use sys.dm_exec_session_wait_stats or sp_WhoIsActive…?

Best Answer

You have a couple of different questions in here.

Can sp_BlitzWho get blocked?

Yes, any query can. There are DMVs that are known to ignore isolation level requests and incur blocking.

Should I use sp_BlitzWho to log wait stats by session?

I wouldn't recommend doing that on a scheduled basis, no. If you need wait stats by session, you're better off with a traditional monitoring tool with a higher sampling rate. You wouldn't want sp_BlitzWho running, say, every 5 seconds, but you really need data at that level of granularity if you want to analyze wait stats by session.

Why shouldn't I log wait stats by session?

Because your server can be a victim of the death-by-a-thousand-cuts scenario: a query that runs thousands of times per second, each time darting in and out, and never accumulating that much wait time each time it runs. However, in total, it can add up to a big deal.