TL;DR




Indexes = direct lookups — milliseconds vs full table scans (seconds).

B-tree for most queries — Supports =, <, >, BETWEEN, LIKE 'prefix%', ORDER BY.

Index WHERE / JOIN / ORDER BY columns — Otherwise full scan.

Composite index order matters — (a, b, c) works for a, a+b, a+b+c — not b or c alone. Equality first, then...