Answering on Stack Overflow(+comments)
summary
Common problems are concrete: missing or redundant indexes, not using composite indexes, and non-sargable WHERE clauses that prevent index use; enabling the slow query log and summarizing it with pt-query-digest usually reveals the top ten offenders and fixing them often drops CPU and latency dramatically. Use EXPLAIN and optimizer_trace to see chosen plans, watch QPS with mytop to spot many tiny queries from ORMs, and prefer rewriting OR conditions as unions or CTEs when the optimizer cannot handle OR efficiently.
AI-written summary · about
