Why use an index, and what is the downside?

3 stars If you are short on time, start with this one.

In one or two sentences
An index is a separate structure that lets the database find rows without reading the whole table. The cost is slower writes and extra storage.

Think of your own answer first

Say it out loud, or type it below. What you type never leaves this device.

Follow-up questions

These are likely next questions from an interviewer. Think of your answer first, then press the button.

  1. 1 / 3

    Why does column order matter in a composite index?

Sources checked