Performance Tuning of the Transaction Log A Peek in the most Critical and Misunderstood Part of SQL Server
May 24, 2015
Performance Tuning of the Transaction Log
A Peek in the most Critical and Misunderstood Part of SQL Server
Sponsors
About me
Senior SQL Server DBA at HP Guest Lecturer at Sofia
University MCITP: SQL 2008 MCSE: Data Platform MCSA: Windows Server 2012 @miro_dd [email protected]
3 |
Agenda
Introduction to Log
Transaction Log Structure
Top reasons for Log Performance Problems
Delayed Durability
Configuration Best Practices
Log Monitoring
4 |
Introduction
What is it actually?
Write Ahead Logging
Log Cache
5 |
Transaction Log Structure
6 |
Virtual Log Files
Log Blocks
Log Records
Top Reasons for Log Performance problems
Unused Non-clustered Indexes
Log Autogrowth Setting
High Availability Features
7 |
sys.dm_db_index_usage_stats
DEMO
Top Reasons for Log Performance problems (2)
Fragmented Indexes
Many tiny transactions
9 |
https://www.flickr.com/photos/83633410@N07/7658225516
sys.dm_db_index_physical_stats
sys.dm_io_virtual_file_stats
sys.dm_io_pending_io_requests
DEMO
Delayed Durability
SQL 2014 Feature
Deferred Log Flushing
Tiny Transactions
Tolerate Data Loss!
11 |
DEMO
Configuration Best Practices
Initial Size
Number of VLFs
TEMPDB Log
Shrinking
Multiple Log Files
Reverting from Snapshot
Physical Location
13 |
https://www.flickr.com/photos/m-i-k-e/7231298090
Log Monitoring
DMVs/DMFs
Performance Monitor Counters
Extended Events
14 |
DEMO
Key Takeaways
Transaction Log is crucial for the SQL performance
Many factors can have effect on it
Indexes – too many, fragmented
Configuration
16 |
Useful Links
Paul Randal: http://sqlperformance.com/2012/12/io-subsyst
em/trimming-t-log-fat
http://sqlperformance.com/2013/02/system-configuration/transaction-log-configuration
Kimberly Tripp: http://www.sqlskills.com/blogs/kimberly/8-step
s-to-better-transaction-log-throughput/
17 |
18 |
Thank You!
Sponsors