SQL Performance — indexing, EXPLAIN plans, query tuning

2025-11-14T00:00:00.000Z

Indexing

  • Composite indexes match your query predicates
  • Avoid leading wildcard LIKEs
  • Covering indexes reduce random I/O

EXPLAIN Plans

  • Check rows examined and key used
  • Detect full scans and filesorts
  • Use ANALYZE to validate statistics

Tuning

  • Shape queries to use indexes
  • Denormalize selectively for hot paths
  • Cache results at the right layer