SQLBits 2012

Revealing the Magic

In this deep(!) dive session. I will walk you through the internal storage format of MDF files. I'll cover how SQL Server stores its own internal metadata, how it knows where to find your data, and how to read it once found.
Think SQL Server is magical? You're right! However, there's some sense to the magic, and that's what I'll show you in this level 500 deep dive session. Through my work in creating OrcaMDF, an open source parser for SQL Server databases, I've learned a lot of internal details for the SQL Server database file format. In this session, I will walk you through the internal storage format of MDF files, how we might go about parsing a complete database ourselves, using nothing but a hex editor. I will cover how SQL Server stores its own internal metadata about objects, how it knows where to find your data on disk, and once it finds it, how to read it. Using the knowledge from this session, you'll find it much easier to predict performance characteristics of queries since you'll know what needs to be done.