liveBook · Manning

Database page

As explained in 100 SQL Server Mistakes and How to Avoid Them

A data page is a fixed-size SQL Server storage unit containing rows or portions of rows from database objects.

A database page is a fixed-size SQL Server storage unit containing rows or portions of rows from database objects. Queries are satisfied from the buffer cache: required pages are read from disk into memory first. Returning more columns or rows than necessary fills the cache faster, releases older pages sooner, and can increase disk reads. section 1.2.1 section 11.0

A common mistake is treating all page layouts as equivalent:

  • Mistake 1—assuming a heap is organized for fast lookup. A heap stores data pages in no particular order, so many queries may read every page in the table. section 11.0
  • Mistake 2—expecting a clustered index to leave pages independent of the key. Its B-tree leaf level is the table’s data pages, ordered by the clustered key; only one clustered index can exist. section 11.0
  • Mistake 3—confusing nonclustered index leaves with table data. They contain pointers to heap or clustered-index pages, allowing multiple nonclustered indexes. section 11.0

Marketing product lookup

A product query that selects only the needed fields reduces unnecessary buffer-cache pressure. However, adding NOLOCK can permit rows that are never committed to be read, so performance caution does not remove consistency risk. section 1.2.1

Figure 11.1 A heap stores pages in no particular order

Use the heap diagram to see why unordered data pages can require broad page reads. section 11.0

Figure 11.2 A clustered index creates a B-tree and orders data pages

Use the clustered-index diagram to connect the B-tree leaf level with the table’s ordered data pages. section 11.0

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains page placement in heaps and indexes and traces cache loading, but does not detail page-size internals.
Examples
Uses heap and clustered-index diagrams plus a product lookup demonstrating selected columns and NOLOCK.
What it assumes
Assumes basic SQL Server query familiarity while introducing heaps, indexes, pages, and buffer-cache behavior.
What you can do after
Evaluate how table organization and query breadth affect page reads, cache pressure, and lookup performance.
How it connects
Connects data pages with heaps, clustered indexes, nonclustered indexes, B-trees, buffer cache, and disk reads.

Also explained in

Compare how 2 books explain database page →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.