# Indexes are sorted arrays (sort of) Most indexes for databases like PostgreSQL, MySQL, and MongoDB are B-trees or B+-trees. These indexes support O(log(n)) look-ups because B-trees are a self-balancing binary search tree. Sorted arrays can partially represent a binary search tree, so thinking about indexes in terms of a sorted array can help you think about performance and index optimization. There's nothing magic about indexes, and they're easier to grok if you think about them in terms of...