Interview questions, answeredLesson 021 min
Interview question: what does a database index do?
An index lets a database find rows by one column without reading the whole table. Without one, searching 100,000 customers for an email means a full table scan, which SQLite's documentation says one normally tries to avoid. An index is a separate table sorted by the searched column, so the plan changes to a search. The cost is extra space.
Remember
Index the columns you search on, not every column.
