liveBook · Manning

B-tree

A B-tree is a balanced multiway search tree that maintains ordered keys and supports efficient searching, insertion, deletion, and sequential access.

How 4 Manning books explain it

Just Use Postgres!

A B-tree index is a balanced tree-based database index that supports ordered searches with logarithmic lookup complexity.

How it is used
Optimizes PostgreSQL equality, range, ordering, filtering, and aggregation queries through sorted indexed access.
How deep it goes
Explains tree structure, linked leaves, logarithmic lookup, execution plans, and practical SQL, without theoretical or implementation-level detail.
Examples
Demonstrates player scores, leaderboards, JSON pizza fields, and smartwatch heart-rate timestamps.
What you can do after
Apply it via PostgreSQL SQL and EXPLAIN to create indexes and verify sequential scans become index-assisted plans.

Read how Just Use Postgres! explains B-tree →

100 SQL Server Mistakes and How to Avoid Them

A B-tree is a balanced, multi-level tree structure whose pages contain keys and pointers for ordered data access.

How it is used
Explains how clustered and nonclustered indexes organize pages for seeks, scans, joins, filters, and aggregations.
How deep it goes
Defines root, intermediate, and leaf levels, then relates leaf contents to seeks, scans, fragmentation, and page splits.
Examples
Illustrates clustered seeks and scans with a B-tree diagram and contrasts a heap diagram with an ordered clustered-index diagram.
What you can do after
Evaluate/understand why key width, index type, and page condition affect read I/O and index-maintenance choices.

Read how 100 SQL Server Mistakes and How to Avoid Them explains B-tree →

PostgreSQL Mistakes and How to Avoid Them

A B-tree index is an ordered database index structure that efficiently supports equality, ordering, and compatible prefix-pattern lookups.

How it is used
Uses B-tree indexes to accelerate equality, ordering, and compatible prefix-pattern queries in PostgreSQL.
How deep it goes
Demonstrates expression indexes and EXPLAIN plans, but defers the B-tree algorithm’s internal mechanics.
Examples
Uses ArXiv JSONB metadata, title-prefix searches, substring searches, oversized abstracts, and DOI equality lookups.
What you can do after
Diagnose/debug with it by comparing predicates against index expressions and reading EXPLAIN ANALYZE output.

Read how PostgreSQL Mistakes and How to Avoid Them explains B-tree →

Grokking Relational Database Design

A B-tree is a self-balancing tree data structure that maintains sorted data and supports search, sequential access, insertion, and deletion in logarithmic time.

How it is used
Speeds database searches, filters, and sorted retrieval by maintaining additional structures over column values.
How deep it goes
Defines balancing, ordering, supported operations, and logarithmic performance, then explains index construction without detailing tree internals.
Examples
Uses movie-rating searches, ordering queries, release-date indexes, and combined rating-and-date indexes.
What you can do after
Operate/configure it by creating database indexes that support frequently searched or sorted columns.

Read how Grokking Relational Database Design explains B-tree →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.