Categories
Sql Server

How Data is stored in Sql server

Data in sql server is stored in Data pages.Pages in a SQL Server data file are numbered sequentially, starting with zero  for  first page in data file. Each file in a database has a unique file ID number. To uniquely identify a page in a database, both the file ID and the page number are required.

sql server data stored

Page size in the sql server is 8kb.That means that sql server have 128 pages in 1MB.Each page begins with a 96-byte header.

 

 

 

Extents :-

  1. Extents are a collection of eight physically contiguous pages and are used to efficiently manage the pages. All pages are stored in extents.
  2. This means SQL Server databases have 16 extents per megabyte.

SQL Server has two types of extents :-

  1. Uniform extents are owned by a single object; all eight pages in the extent can only be used by the owning object.
  2. Mixed extents are shared by up to eight objects. Each of the eight pages in the extent can be owned by a different object.