Database

Disk <-> Database <-> Web Server <-> Response <-> Client
  • Dont add index for a small table. Full Table Scan is faster.
  • foreign key should be indexed
  • Column appear on join condition => index candidate
  • 15% rows => Index OK.
  • low cardinality = very few possible rows
  • Sharding