SQL Server Page Types detailed

Source: Internet
Author: User
Tags mixed sort

SQL Server contains several different types of pages to meet the needs of your data store. Regardless of the type of page, their storage structure is the same. Each data file contains a significant number of 8KB pages, each page has 8192bytes available, each page has 96byte for the header storage, and the rest of the space

is used to store the actual data, at the end of the page is the data row offset array, can also be called "page slot" array, we can take a page as a bookcase, which row of data occupies which slot, are marked at the end of the page, and the page Mantissa group write order is flashbacks, so you can effectively use the page space.

It can be foreseen that the "slot" on the page is not necessarily stored in order, when a new ID comes in, and the ID is between the maximum ID and the minimum ID of the page (a leaf page that is sorted by id), then the ID data row is inserted directly behind the existing data row. When a query needs to retrieve the row where the ID is located,

The database engine finds the leaf page from the index page, loads the page into memory, and finds the corresponding row by the row offset array at the end of the page. The record size of the page mantissa group is stored in the page head, and each record of the page slot in the array occupies 2bytes of space.

As far as I know, there are 14 kinds of page types for SQL Server data files:

Type 1--data page:

Data pages in the heap

The leaf page in a clustered index

The location in the data file is random

M_type=1 in DBCC PAGE

Type 2--Index page:

Non-clustered index

Non-"leaf"-Level clustered index

The location in the data file is random

m_type=2 in DBCC PAGE

Type 3--text Mixed page (text Mixed page):

Short-length LOB data types, multiple types, multiple-line storage

The location in the data file is random

M_type=3 in DBCC PAGE

Type 4--text page (Text tree page):

Store a single LOB row

The location in the data file is random

M_type=4 in DBCC PAGE

Type 5--sort page (Sort page):

Temporary page when sorting operations

Common in tempdb, also visible in the "online" operation in user data (for example, when creating an index online without specifying the SORT_IN_TEMPDB option)

The location in the data file is random

M_type=19 in DBCC 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.