AlgoGymPreparationInterview Preparations
Cool NotesIndexes and query plans
All notes

Indexes and query plans

SQL · Original AlgoGym revision note with a source for deeper study.

SQL
  1. Indexes speed selective lookups but add write and storage cost.
  2. Column order matters in a multicolumn index; test representative predicates.
  3. Use EXPLAIN ANALYZE to compare actual rows and time with the planner estimate.
Read more at MySQL documentation