<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd" -->

---
title: Database Animations: How Index Seeks Work | daily.dev
description: An animated walkthrough of how B-tree index seeks work in SQL Server, covering root pages, intermediate pages, and leaf pages. Explains how SQL Server...
canonical: https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Database Animations: How Index Seeks Work | daily.dev
og:description: An animated walkthrough of how B-tree index seeks work in SQL Server, covering root pages, intermediate pages, and leaf pages. Explains how SQL Server...
og:url: https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd
og:image: https://api.daily.dev/og/posts/Y2bMYbkQd.png
og:image:alt: Database Animations: How Index Seeks Work
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Animations: How Index Seeks Work

**[Brent Ozar](https://daily.dev/sources/brentozar)** · 7 min read · 0 upvotes · 0 comments

## Summary

An animated walkthrough of how B-tree index seeks work in SQL Server, covering root pages, intermediate pages, and leaf pages. Explains how SQL Server traverses the tree to find a specific row, why logical reads accumulate during a seek, and how nonclustered indexes differ from clustered ones — including the key lookup mechanism. Also touches on doubly-linked leaf pages for range scans and why page numbers don't need to be contiguous.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.brentozar.com/archive/2026/07/database-animations-how-index-seeks-work>

## Questions this post answers

### How does a SQL Server index seek traverse the B-tree to find a row?

SQL Server starts at the root page of the B-tree, which acts like a table of contents pointing to intermediate directory pages covering ranges of values. It follows these intermediate pages down through the tree until it reaches the leaf page holding the actual row data. Each page opened counts as a logical read, so deeper trees on larger tables require more logical reads per seek.

_Developers debugging slow queries can dig into index internals like this through daily.dev._

### What is the difference between a clustered index seek and a nonclustered index seek in SQL Server?

A clustered index stores the actual row data on its leaf pages, so a seek there finds the row directly. A nonclustered index's leaf pages instead store the indexed column's value plus the row's clustered index key, so a seek there often requires a second seek called a key lookup on the clustered index to fetch the rest of the row's data.

_Anyone tuning SQL Server queries can track explanations like this via daily.dev._

### Why do SQL Server leaf pages need to be doubly linked lists?

Leaf pages in a SQL Server index are doubly linked, with each page pointing to both the previous and next page, so range scans can move directly from one leaf page to the next without climbing back up through the intermediate and root pages. This makes reading a range of values, such as ids between 9500 and 13800, efficient after an initial seek to the starting point.

_Engineers optimizing range queries can follow deep-dives like this on daily.dev._

## Similar posts on daily.dev

- [Database Animations: How SQL Server’s JSON Indexes Work](https://daily.dev/posts/database-animations-how-sql-server-s-json-indexes-work-sdzvqupb8) · Brent Ozar · 0 upvotes · 0 comments
- [Things you didn't know about indexes](https://daily.dev/posts/things-you-didn-t-know-about-indexes-a4znm2ugw) · Lobsters · 0 upvotes · 0 comments
- [Database Animations: You’ve Heard of Page Splits. Here’s What They Really Mean.](https://daily.dev/posts/database-animations-you-ve-heard-of-page-splits-here-s-what-they-really-mean--rhgklbaxy) · Brent Ozar · 2 upvotes · 0 comments
- [How Database Indexes Work – A Practical Guide with PostgreSQL Examples](https://daily.dev/posts/how-database-indexes-work-a-practical-guide-with-postgresql-examples-8anfbdgcl) · freeCodeCamp · 72 upvotes · 0 comments
- [Introduction to PostgreSQL Indexes ::](https://daily.dev/posts/introduction-to-postgresql-indexes--peasixbnz) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server)

[View this post on daily.dev](https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Database Animations: How Index Seeks Work","url":"https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd"},"datePublished":"2026-07-16T13:17:23.532Z","dateModified":"2026-09-14T06:13:40.560Z","description":"An animated walkthrough of how B-tree index seeks work in SQL Server, covering root pages, intermediate pages, and leaf pages. Explains how SQL Server...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"Brent Ozar","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Brent Ozar","logo":"https://media.daily.dev/image/upload/s--uHhajUhc--/c_limit,w_256/f_auto,q_auto/v1780213426/logos/brentozar?_a=BAMAMiWQ0","url":"https://daily.dev/sources/brentozar"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,microsoft-sql-server","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Brent Ozar","item":"https://daily.dev/sources/brentozar"},{"@type":"ListItem","position":3,"name":"Database Animations: How Index Seeks Work"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/database-animations-how-index-seeks-work-y2bmybkqd#faq","mainEntity":[{"@type":"Question","name":"How does a SQL Server index seek traverse the B-tree to find a row?","acceptedAnswer":{"@type":"Answer","text":"SQL Server starts at the root page of the B-tree, which acts like a table of contents pointing to intermediate directory pages covering ranges of values. It follows these intermediate pages down through the tree until it reaches the leaf page holding the actual row data. Each page opened counts as a logical read, so deeper trees on larger tables require more logical reads per seek. Developers debugging slow queries can dig into index internals like this through daily.dev."}},{"@type":"Question","name":"What is the difference between a clustered index seek and a nonclustered index seek in SQL Server?","acceptedAnswer":{"@type":"Answer","text":"A clustered index stores the actual row data on its leaf pages, so a seek there finds the row directly. A nonclustered index's leaf pages instead store the indexed column's value plus the row's clustered index key, so a seek there often requires a second seek called a key lookup on the clustered index to fetch the rest of the row's data. Anyone tuning SQL Server queries can track explanations like this via daily.dev."}},{"@type":"Question","name":"Why do SQL Server leaf pages need to be doubly linked lists?","acceptedAnswer":{"@type":"Answer","text":"Leaf pages in a SQL Server index are doubly linked, with each page pointing to both the previous and next page, so range scans can move directly from one leaf page to the next without climbing back up through the intermediate and root pages. This makes reading a range of values, such as ids between 9500 and 13800, efficient after an initial seek to the starting point. Engineers optimizing range queries can follow deep-dives like this on daily.dev."}}]}
```

