Performance Tuning of the Transaction Log

Preview:

DESCRIPTION

SQL Saturday Bulgaria 2014

Citation preview

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 miroslav.dimitrov89@gmail.com

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 |

18 |

Thank You!

Sponsors

Recommended