▶ Interactive Lab

B-tree Index Visualizer

Insert values; see B-tree splits and growth.

Advertisement
B-tree of order M: each node has up to M-1 keys. Insert causes splits when full.

What you're seeing

B-tree is the workhorse index structure in Postgres, MySQL, SQLite. Order M = max children per node. When a node has M keys, it splits — middle key moves up. Tree height stays O(log_M N) → fast lookups.

Postgres default page size 8KB ≈ order 100-300 for typical key sizes. Real B-trees are very wide and shallow.

★ KEY TAKEAWAY
B-tree of order M has up to M-1 keys per node. Inserts cause splits; tree stays O(log_M N) tall.
▶ WHAT TO TRY
  • Click Random ×5 to add nodes.
  • Watch splits happen — middle key promotes up.