WordPress database indexes
An index is a lookup table the database keeps next to your data. Without one, finding the rows for a query means reading the whole table, row by row. With one, the database jumps straight to the rows it needs. On a site with a large wp_postmeta or wp_options table, that is the difference between a page that renders quickly and one that visitors notice waiting for.
WordPress does not create all of these indexes when it installs. Cyberfusion does.
Wondering whether your site has them, and how to add the ones it is missing? This article explains where the recommendations come from and how to apply them.
Where to find the page
There are two ways to navigate to the database indexes of a site.
Directly
- Navigate to 'Advanced' > 'Virtual Hosts'.
- Select the virtual host.
- Navigate to 'Database Indexes'.
Via the project
- Navigate to 'Projects'.
- Select the project.
- Navigate to 'Advanced' on the environment you want.
- Under 'Virtual Host', click 'Manage'.
- Navigate to 'Database Indexes'.
What the page shows
When you open the page, Cyberfusion asks the site which of the recommended indexes are missing, and lists them by table and column.
If nothing is missing, the page says so: 'All recommended indexes are created. Nothing to do.'
Because the check runs against the live site, the page always reflects the database as it is right now, not a stored result from some earlier moment.
Creating the missing indexes
Click 'Create Missing'. Cyberfusion creates exactly the indexes in the list, and nothing else.
Creating an index does not change your content or your WordPress configuration. It adds a lookup structure the database maintains from then on, which costs a small amount of disk space and makes the affected queries faster.
Sites that never need this
WordPress sites created through Core get the recommended indexes as part of the install, before the site is handed to you. The same goes for a WordPress site installed automatically when you create a project environment.
The 'Database Indexes' page is for the other cases: a site you migrated in from another host, or one that was set up on the server outside Core.
The matching health check
You do not have to check each site by hand. The 'Database indexes created' health check flags sites with missing indexes per cluster, and its wrench button takes you straight to this page. See All about health checks.