Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 April SQL Server: The Internal Structure of the Data Page

SQL Server: The Internal Structure of the Data Page

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

The Page in a SQL Server is a small storage unit of data and it resides in a Data File.

When we write the first row in a table, it creates an 8KB page to store the data, and it assigns 0 as a starting number and sequentially increase in a data file.

Each data file has a unique file ID number, and each page has a unique page number.
We can store 128 pages per one megabyte.

The 8KB page doesn’t associate with a single row of data.
If row size is small, multiple rows can store into an 8KB data page. If row size is large and 8KB page is not sufficient to store it, it creates multiple pages.

Each table has a separate data page, and it never merges data
from multiple tables. Even if we have small size of the table, it also creates separate pages for each table.

SQL Server uses different types of pages to store various types of data like Index, Data, Text, BLOB.

The different type of pages are:

Data: stores user’s data, but type of text, ntext, nvarchar(max),varchar(max),varbinary(max),xml, and image.

Index: stores index related data.

Text/Image: stores all large object data type like text,varchar(max).

GAM: stores global allocation map information about extents.

Page Free Space: stores information about the free space of the pages.

IAM: stores index allocation map information about the indexes.

BCM: stores bulk changed map information of the extents.

The internal structure of the Page:

SQL Server Data Page Structure

A Data Page consists of three main sections which are Page Header, Actual Data and Row offsets.

Each Data Page has 96-byte header to store system information like page number, page type, free space, page owner’s object id.

After the header information, actual data rows are put on the page serially.

There is one-row offset table at the end of the page, and it stores information about each row.

The records within a page are not always stored in continuous logical order, and the free-space on a page is not always maintained in one contiguous block.

If we delete a record, it creates one free hole within the page, and immediately it cannot be used by new INSERT.

It creates fragmentation on a page and when it is necessary, INSERT check the free block and try to insert best match record into that free block.

This all row’s information kept by the Row offset table.
The Database Administrator also has to perform some maintenance task to remove fragmentation from the data pages.

Apr 13, 2016Anvesh Patel
SQL Server: The internal storage architecture of the Database FilesSQL Server: What happened, when Row Overflow and Data Exceeding 8KB?
Anvesh Patel
Anvesh Patel

Database Engineer

April 13, 2016 SQL Server8KB Data Page, Anvesh Patel, Data File, database, database research and development, dbrnd, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....