Unvisited row
Scanned row
Target found
Index node visited
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.
This simulator makes the cost of a database query physically visible. Rows sit in a grid representing their raw storage order; a B-tree index floats above as a small sorted tree of pointers. Run a query without an index and you'll watch the engine read row after row until it stumbles onto the target — a full table scan. Switch the index on and the same query instead descends a handful of tree levels and jumps straight to the answer. Grow the table and the gap between the two only widens: the scan's cost tracks N directly, while the index's cost tracks log₂(N).