B-Trees: Why Every Database Uses Them
Your database has 10 million user records. You query for one user by ID. The database returns the result in 3 milliseconds. How?If the database scanned all 10 million records sequentially, it would take seconds, maybe minutes. But databases don’t scan. They use an index—and that index is almost certainly a B-Tree.Every major database system uses B-Trees: MySQL InnoDB, PostgreSQL, SQLite, MongoDB’s WiredTiger storage engine, Oracle Database, Microsoft SQL Server. It’s not a coincidence. B-Trees s...
Read more at mehmetgoekce.substack.com