Database Performance Tuning 101: How to Identify, Isolate and Fix Slow or Duplicate SQL Queries in Production
Most slow websites aren't slow because the server is too small. They're slow because a handful of database queries do far more work than they need to, or run far more often than they should. This guide walks through a simple, repeatable loop for finding those queries in production, understanding why they're slow, fixing them safely, and proving the fix worked. Examples cover MySQL / MariaDB (which WordPress uses) and PostgreSQL.
