Performance and monitoring
Improve WordPress database performance with Index WP MySQL For Speed
Index WP MySQL For Speed lets you add or change indexes on certain WordPress and WooCommerce tables. It can help on large installations when queries benefit from those indexes; it is not a plugin every site needs.
An index makes it easier to find rows without scanning the whole table, but it takes up space and has a cost when inserting or updating data. WordPress already creates indexes: the job is to assess whether others fit the real queries better.
Before changing tables
Identify a slow operation and keep its measurement and plan. Keep a recoverable backup of the database and test on a clone with representative data. Check the plugin's requirements, the table engine, any custom indexes and the free space needed.
If it proposes converting the table engine or format, treat that as a separate maintenance operation. On large tables it can take time, block work or need extra space. Schedule a suitable window.
Review and apply from WordPress
Install the plugin from the official repository and open Tools > Index MySQL. Review the selected tables and the operation before clicking Add Keys Now. Do not select them all just because it is the quickest option.
For large tables, the developer provides WP-CLI. From the correct installation you can check the status and preview the SQL:
wp index-mysql status wp index-mysql enable --all --dryrun
The second command shows the changes without running them. Do not pipe it into wp db query, because then you would run them. The proposal reflects the tables' current state; do not save that SQL to run later without regenerating it.
After validating the clone and choosing the tables, use the apply command given by wp help index-mysql for your version. WP-CLI avoids some browser limits, but it does not remove resource limits or guarantee that the operation will not fail.
Check and revert
Compare the slow queries before and after over several runs. Also check inserts, imports, editing, purchases and scheduled tasks. Deactivating the plugin does not mean the indexes it created have been removed.
The plugin offers to restore the standard indexes. Before using that feature, review the custom indexes that existed beforehand: going back to the standard schema is not necessarily the same as your original schema. Keep their definition and the verified backup.
If you use the plugin's query monitor, limit the sample and review the data before exporting it. Do not upload reports containing personal information or secrets without considering their content and destination.
You may also find useful
- Diagnose slow LEFT JOIN queries in WordPress Analyse slow taxonomy queries with LEFT JOIN, compare plans and alternatives on a copy and avoid unm...
- SQL queries to clean orphaned data and purge the WordPress database Clean orphaned data, revisions and transients in WordPress with verified queries, a recoverable back...
- Slow "SELECT SQL_CALC_FOUND_ROWS" SQL queries Diagnose slow WordPress queries with SQL_CALC_FOUND_ROWS, find where they come from and validate any...
- How to load the reCAPTCHA script with Contact Form 7 only where it is needed Assess the cost of reCAPTCHA in Contact Form 7 and limit where it loads only after identifying every...
Something wrong or out of date? Tell us and we will review it.