04 - Indexing Deep Dive
What is an Index?
An index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional storage and slower writes.
Analogy: Book Index vs Database Index
Plain text
Shared from "Study" on Inkdown
An index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional storage and slower writes.
Most database indexes use B-Tree (Balanced Tree) structure:
Selectivity = (Number of unique values) / (Total rows)
Higher selectivity = better index performance