Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Understanding the mdf file format

$
0
0

I know this does not really fit the section, but I think the other sections do not fit any better, so I write here. Please move, if I missed a better place for this post.

I want to have a rough understanding of the mdf format and the best source of information I found is https://docs.microsoft.com/en-us/sql/relational-databases/pages-and-extents-architecture-guide?view=sql-server-ver15Questions:

1. If the PFS lists information for 8088 pages, why is the second PFS page 8088 and not 1 (first_PFS_page) + 8088 + 1 =8090? And are the other metadata pages (like GAM) treated the same way as data pages from the PFS point of view?
2. How does the database server determine the supposed size of a mdf file? Form my understanding page 0 does not contain a size information, but the server has to parse either GAM or PFS, correct? (probably GAM, as it is more coarse-grained and thereby faster?)
3. How can the database determine whether there is an n-th PFS page or the database mdf file is broken, if the last page of the n-1th section was allocated?



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>