Data page structure for SQL Server

Source: Internet
Author: User

Data page structure for SQL Server

In the forum, people often ask how SQL Server is the base table data, since do not want to check MSDN, I'm here to say it

How is each row of data stored in the data page?

Structure: Each SQL Server data page is roughly divided into 3 parts: page header, footer offset, data storage these 3 parts

Suppose you now have a table with the structure:

CREATE TABLE Test (

A INT,

b INT

)

He stores the data on the 1:100 page (1 is the data file ID of the database i.e. fileid,100 is the PageID page number).

This page structure is roughly the following figure

In the first part of the page, records page properties, including page numbers, and also records where the current page's idle portion starts, so that SQL Server can quickly find where to begin inserting new data, and the offset at the end of the page records the starting position of each data row. So when SQL Server is looking for every record, it can quickly find a way to confuse the previous record with the latter. There are now two entries on the Legend page: (1,100) and (2,200) the beginning of the first record is 96, the beginning of the second record is 111, starting from 126, is free space when the data row in the page changes, SQL Server not only to modify the data itself, You also modify the values of these offsets to ensure that SQL Server continues to accurately manage each row in the data page.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.