You have excessive WRITELOG waits (or HADR_SYNC_COMMIT waits) and among other things, you want to understand where.
Microsoft’s advice Diagnosing Transaction Log Performance Issues and Limits of the Log Manager remains a great resource. They tell you to use perfmon to look at the
log bytes flushed/seccounter (in the
SQL Server:Databasesobject) to see which database is being written to so much.
After identifying a database you’re curious about, you may want to drill down further. I wrote about this problem earlier in Tackle WRITELOG Waits Using the Transaction Log and Extended Events. The query I wrote for that post combines results of an extended events session with the transaction log in order to identify which procedures are doing the most writing.
But there are times when you just want a quick and dirty script, and that’s what Michael has for us today.