Database indexing sounds technical, but the core idea is something everyone already intuitively understands.
The Book Index Analogy
Finding a topic in a book by flipping through every page is slow; using the index at the back to jump directly to the right page is fast. A database index works exactly the same way.
Why It Speeds Things Up
Without an index, a database has to scan every single row to find matches — with one, it can jump directly to relevant rows, especially valuable on large tables.
The Trade-Off
Indexes speed up reading data but add a small cost to writing it, since the index itself needs updating too — which is why not every column should be indexed indiscriminately.
Español
Deutsch