MySQL Optimization Basics for Website Owners

When your site slows down as it grows, the database is usually the culprit. You do not need to be a DBA to fix the common issues.
Find the slow queries
Enable the slow query log (queries taking over 1–2 seconds). In WordPress, the Query Monitor plugin shows per-page query counts — anything over 50–100 queries per page deserves investigation.
Indexes are everything
An index is like a book's index page — without one, MySQL reads every row. The most common win: indexing foreign keys and WHERE-clause columns on large tables.
Clean up regularly
- Delete post revisions beyond the last few (they accumulate silently).
- Clear expired transients — orphaned cache entries bloat the options table.
- Empty spam and trash on a schedule.
Right-size your tables
Use the correct column types — INT vs BIGINT, VARCHAR(255) vs TEXT — it affects both speed and memory usage at scale.

