The short answer

B-Tree vs B+ Tree comes down to one structural choice: where record pointers live. Both are self-balancing, multi-way search trees built for disk storage. A node is sized to match one disk block, so a wide branching factor keeps the tree shallow. In a B-tree, every node, root, internal, and leaf, holds keys together with record pointers. A search can therefore end at any level, even the root. There is no link between leaves. In a B+ tree, internal nodes hold only keys, acting as separators that route the search. Every record pointer sits in a leaf instead. Leaves are linked in a sequential list, so a range scan walks forward without climbing back up. Because internal nodes carry no record pointers, more keys fit in one block. More keys per block means higher fanout, and higher fanout means a shallower tree. A shallower tree needs fewer block reads per lookup. Most database indexes, and many filesystems, use B+ trees for exactly that reason.

B-trees and B+ trees both grew from the same problem: how to search fast when data sits on disk. Rudolf Bayer and Ed McCreight introduced the B-tree in 1972. The B+ tree came later, as a variant tuned for range scans and sequential access.

Students often treat the two as one structure with two names. They are not. One design choice, where record pointers live, separates them completely.

Binary search trees, compared in binary tree vs binary search tree, cap each node at two children. B-trees and B+ trees generalise that idea for many children.

Two small trees compared, the B-tree showing record pointer markers on the root and on every leaf, and the B+ tree showing markers only on the leaves with keys alone in the root
A B-tree holds record pointers at every level. A B+ tree keeps them all in the leaves.

Why Disk-Based Trees Look Different

A B-tree or B+ tree node is not a small object sitting in RAM. It is sized to fill one disk block. Reading a block from disk costs far more than comparing a few keys in memory.

So the design goal shifts. In a plain binary search tree, the metric that matters is comparisons. In a disk-based tree, the metric that matters is block reads. That is the number of nodes a search must fetch from disk.

That distinction is really about time complexity in a different cost model, the kind covered in data structure efficiency and time complexity. Counting block reads instead of comparisons changes which structure wins.

A wide node holds many keys, so one block read narrows the search a lot. That is why both trees chase high fanout: fewer levels, fewer block reads, faster lookups.

How a B-Tree Stores Data

A B-tree keeps keys and record pointers together, at every node. The root holds keys and pointers. Every internal node holds keys and pointers. Every leaf holds keys and pointers too.

A search walks down the tree, comparing the target key against the keys in each node it visits. If the target key sits in a node the search already reached, its record pointer is right there. The search can stop then, without ever touching a leaf.

There is no link between one leaf and the next. A range scan often spans several leaves. Each one means climbing back up to a parent, then back down again.

The main advantage is early termination. So a frequently searched key stored near the root returns fast, sometimes after a single block read.

The cost shows up in fanout, though. Every node carries record pointers alongside keys, so fewer keys fit in one block. Fewer keys per block means more levels, and more levels mean more block reads on average.

How a B+ Tree Stores Data

A B+ tree splits the two jobs a B-tree combines into one. Internal nodes route the search. Leaf nodes hold the data.

An internal node stores keys only, with no record pointers attached. Each key acts as a separator, marking the boundary between two child subtrees.

Every record pointer lives in a leaf instead. A search therefore always travels the full height of the tree, ending at a leaf, never earlier.

Leaves connect to each other in sequence. Once a search reaches the right leaf, a range scan walks forward without climbing back up the tree.

A clustered index, compared in clustered vs non-clustered index, is really a B+ tree under the hood. Rows sit at the leaves, in key order, ready for a scan.

A separator key in an internal node also appears again in a leaf. That duplication is expected, not a flaw; it is how a separator still marks a real record’s position.

Removing record pointers from internal nodes raises the fanout, and higher fanout keeps the tree shallow. That is why most database indexes, and many filesystems, use B+ trees for lookups and range scans alike.

The tradeoff is uniform cost. Every search reaches a leaf, even when the key sits high in the tree. A B-tree can occasionally return faster, simply by stopping early.

B-Tree vs B+ Tree: Comparison Table

Infographic comparing B-tree and B+ tree on where records live, whether leaves are linked, where a search can end, and how many keys fit in a block
B-tree vs B+ tree at a glance: record placement, leaf links, where search ends, keys per block.
AspectB-TreeB+ Tree
Where record pointers liveEvery node: root, internal, and leafLeaves only
What internal nodes holdKeys plus record pointersKeys only, acting as separators
Where a search can endAny level, including the rootAlways at a leaf
Leaf linkingNo link between leavesLeaves linked in a sequential list
Range and sequential scan costRepeated climbs back up between leavesOne forward walk across linked leaves
Keys per block (4096-byte example)170 keys, 171 child pointers255 keys, 256 child pointers
Resulting tree heightTaller, for the same record countShorter, from the higher fanout
Uniformity of search costVariable, can stop early or go deepUniform, always reaches a leaf
Key duplication across levelsNot expectedExpected, separator keys reappear in leaves
Deletion complexityCan remove a key directly from any levelMust rebalance from a leaf and fix separators above it
Space use in internal nodesMore space per key, since a pointer travels with itLess space per key, separators only
Typical real-world useLess common in modern database enginesMost database indexes and many filesystems
Behaviour on full-table ordered scansRepeated root-to-leaf traversalsSingle forward walk over linked leaves
What happens to internal nodes on deleteMay lose a record pointer directlyOnly separator keys need adjusting, not records

Worked Example: How Many Keys Fit in a Block

Fanout is not abstract. It comes straight from block size and pointer size, arithmetic any student can redo in an exam.

Assume a disk block of 4096 bytes. A key takes 10 bytes. A record pointer takes 8 bytes. A block pointer takes 6 bytes. Let n be the number of keys stored in a node.

Start with the B-tree case. A B-tree node holds n keys, n record pointers, and n+1 block pointers. Each key still pairs with its own record pointer.

  • Space needed: 6(n + 1) + (10 + 8)n ≤ 4096
  • Expand the block-pointer term: 6n + 6 + 18n ≤ 4096
  • Combine the n terms: 24n + 6 ≤ 4096
  • Subtract 6 from both sides: 24n ≤ 4090
  • Divide by 24: n ≤ 170.41
  • Round down to a whole number of keys: n = 170

So one B-tree node holds 170 keys and 171 child pointers, one more pointer than keys.

Now the B+ tree case. An internal node here drops the record pointers entirely. It holds only n keys and n+1 block pointers.

  • Space needed: 6(n + 1) + 10n ≤ 4096
  • Expand the terms: 6n + 6 + 10n ≤ 4096
  • Combine the n terms: 16n + 6 ≤ 4096
  • Subtract 6 from both sides: 16n ≤ 4090
  • Divide by 16: n ≤ 255.625
  • Round down to a whole number of keys: n = 255

So one B+ tree internal node holds 255 keys and 256 child pointers.

Compare the two results directly. A B+ tree node fits 256 children. A B-tree node fits only 171. That works out to 1.50 times the fanout, gained by removing one field per key.

Follow that number through to its consequence. A wider node needs fewer levels to index the same number of records. Fewer levels mean fewer block reads for every lookup. Add linked leaves on top, and a range scan becomes one sequential walk instead of many separate root-to-leaf trips. Fanout, height, block reads, linked leaves: that chain is the entire argument for a B+ tree. It explains why database engines choose it over a B-tree.

Why Range Queries Favour the B+ Tree

Two rows of leaf nodes, the B+ tree row joined by horizontal arrows marked linked and the B-tree row with no links between its leaves
Linked leaves turn a range query into a sequential walk. A B-tree has to climb back up.

A range query asks for every key between two bounds, not just one exact match.

In a B+ tree, the search finds the first matching leaf once. From there, the linked list of leaves carries the scan forward, key after key, until the range ends.

A B-tree can run a range query too; nothing blocks it from doing so. Without leaf links, though, it must climb back up to a parent and back down again for each new leaf. So that repeated climbing adds extra block reads.

So the real win for the B+ tree is not that range queries are impossible on a B-tree. It is that linked leaves turn a scan into one sequential pass instead of many separate traversals.

Order, Degree and the Minimum Fill Rule

GATE questions usually define a B-tree, or a B+ tree, by its order, written as m.

A node holds at most m − 1 keys. It holds at most m children, one more child than keys.

Still, a non-root internal node cannot be too empty. It needs at least ⌈m/2⌉ children, and therefore at least ⌈m/2⌉ − 1 keys.

The root is exempt from that minimum. It needs only one key, since it has no parent to keep it half full.

Leaf capacity in a B+ tree is where textbooks disagree slightly. Some count leaf slots the same way as internal nodes. Others size leaves around the record pointers each leaf holds instead. An exam question usually states its own convention, so read the given definition before applying any formula.

Where Each One Is Used

Most relational database indexes use a B+ tree, not a plain B-tree. MySQL’s InnoDB, PostgreSQL, and Oracle all build their default indexes this way.

Several filesystems use B+ trees too, for the same reason: fast lookups alongside fast sequential directory scans.

Plain B-trees still show up in a few in-memory indexing structures and older filesystem designs. Early termination matters more there than range scans.

Not every access pattern fits a B+ tree, though. Spatial data, compared in quad trees vs KD-trees, needs a structure built around location instead.

Indexing sits alongside other DBMS design choices too. Schema design brings its own tradeoffs, covered in lossless vs lossy decomposition.

Interview Questions

Because a B+ tree’s internal nodes drop record pointers entirely. Only keys and block pointers remain, so each key costs less space. For a 4096-byte block with the sizes used here, that difference is 171 child pointers for a B-tree. A B+ tree fits 256.

Yes, a B-tree can still run a range query. It simply has no link from one leaf to the next. So it must climb back to a parent node and down again for every new leaf. That extra climbing costs more block reads than a B+ tree’s forward walk.

Because record pointers only exist at the leaf level. A key can appear again as a separator higher up, but that copy carries no pointer to the actual record. The search has to keep going until it reaches the leaf copy, so lookup cost stays uniform.

So, height goes down for the same number of records. A wider node indexes more children per level, so fewer levels are needed to reach every record. Since each level costs one block read, a shorter tree means fewer block reads per lookup.

Frequently Asked Questions

A B-tree keeps record pointers at every node, root, internal, and leaf. A B+ tree keeps record pointers only at the leaves, and its internal nodes hold separator keys instead. That one choice sets the fanout, the tree height, and how each one handles range queries.

No, that description fits a B+ tree, not a B-tree. Every node in a B-tree carries record pointers, including the root and every internal node. A search can stop as soon as it finds the key, at any level, not only at a leaf.

Because dropping record pointers from internal nodes raises the fanout, and a higher fanout keeps the tree shallow. Linked leaves also turn range scans into one sequential pass. Most database indexes, and many filesystems, use B+ trees for exactly those two reasons.

Yes. A B-tree can run a range query, since nothing about its structure blocks that. It just lacks links between leaves. So it must climb back up to a parent and down again for each new leaf. That costs extra block reads, compared with a B+ tree.

A separator key stored in an internal node also appears again in a leaf. The matching record pointer actually lives there. That duplication is expected, not a design flaw. It is how a B+ tree routes a search while still keeping every record pointer at the leaf level.

No. A binary search tree caps every node at two children. B-trees and B+ trees are multi-way search trees instead. Each node fills a disk block and holds far more than two children. The goal is a wide, shallow tree that needs few block reads.

Wrapping Up

B-Tree vs B+ Tree is not a contest with one universal winner. Both are multi-way search trees built for disk, and one design choice separates them.

Keep that one choice close for exams. A B-tree keeps record pointers at every node, so a search can stop early, but fewer keys fit per block. A B+ tree keeps record pointers only at the leaves, so fanout goes up. The tree gets shorter, and linked leaves make range scans sequential.

So the honest framing is a tradeoff, not a flaw on either side. Reach for the fanout math whenever a question asks how many keys fit in a block. Reach for the linked-leaf argument whenever a question asks about range queries.

Related reading on DiffStudy:


Whatsapp-color Created with Sketch.

By Arun Kumar

Full Stack Developer with a BE in Computer Science, working with React, Next.js, Node.js, MongoDB, and AI/ML tools. Founder of DiffStudy — built to help CS students ace GATE and university exams, and keep developers up to date across AI, cloud, system design, web development, and every field of computer science. Every article is written from real hands-on experience, not just theory.

Leave a Reply

Your email address will not be published. Required fields are marked *


You cannot copy content of this page