How to Optimise a MySQL Database
Over time, databases accumulate overhead that slows queries and wastes space. Optimising reclaims it — a quick, safe maintenance task.
Step-by-step
- Back up the database first via export.
- Open Databases → phpMyAdmin and select your database.
- Look at the Overhead column in the table list — tables with overhead benefit from optimising.
- Tick the tables (or Check All).
- Choose "Optimize table" from the "With selected" dropdown at the bottom.
- Confirm completion — overhead drops to zero and queries run leaner. Repeat occasionally as part of maintenance.
💡 Good to know
- WordPress sites benefit from clearing post revisions and spam comments before optimising.
- A leaner database is one part of speeding up your site.
- Schedule periodic optimisation if your site writes a lot of data.