Slow queries waste everyone's time — yours, your dashboard's, and your server's. Most optimisation wins come from a short list of repeatable techniques rather than dark magic.
Key Points
- Index the columns in your WHERE, JOIN and ORDER BY clauses
- Select only needed columns — SELECT * drags extra data through the network
- Never wrap indexed columns in functions: WHERE YEAR(dt)=2026 kills the index; use ranges instead
- Use LIMIT when exploring large tables
- Prefer EXISTS over IN for large subquery results
- Read EXPLAIN before and after each change to confirm the improvement
.png)