Paul Randal (@PaulRandal) of SQLskills continues his series on knee-jerk performance troubleshooting. In this post, he talks about SOS_SCHEDULER_YIELD, and how to determine whether it is a wait to worry about in your scenario.
In my previous post on streamlining the operations of the transaction log, I discussed two of the most common causes of extra log records being generated: dead weight from unused nonclustered indexes and page split operations (that cause index fragmentation). Assuming you've read that post, I mentioned that there are more subtle problems that can be detrimental to transaction log performance, and I'm going to cover these here.
In many SQL Server workloads, especially OLTP, the database's transaction log can be a bottleneck that adds to the time it takes a transaction to complete. Most people assume that the I/O subsystem is the real bottleneck, with it not being able to keep up with the amount of transaction log being generated by the workload.
I recently encountered high TRANSACTION_MUTEX accumulated wait time on a client system. I couldn't recall a case where I saw this wait type as near the top of the "high waits" list and I was curious about what factors could push this type of overall wait time.
The Books Online definition of TRANSACTION_MUTEX is that it "occurs during synchronization of access to a transaction by multiple batches." Not many areas within the SQL Server engine expose this type of functionality, so my investigation was narrowed down to the following technologies: