P

PrepStack

Indexing & File Organization

An index is a separate structure, usually sorted, that lets the database find rows without reading the whole table. Interviewers ask about it because the B+ tree (a balanced, many-branched search tree), clustered versus secondary indexes, and the order of columns in a multi-column index decide whether a query takes milliseconds or minutes. After this section you can explain how a B+ tree lookup works and why it stays shallow, say what an index costs, choose the column order of a composite index, and compare B+ tree and hash indexes.

Topics in this section