Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

What is a database index? B-tree intuition.

FresherFundamentalsDatabase Fundamentals
Model answer

B-tree index

Index is separate sorted structure (usually B-tree) mapping key → row locator—speeds WHERE/JOIN on indexed columns at cost of write overhead and storage.

sql
CREATE INDEX idx_students_dept ON students(dept);
Leftmost prefix rule for composite indexes (dept, score).