Skip to content

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

Directly

  1. Navigate to 'Advanced' > 'Virtual Hosts'.
  2. Select the virtual host.
  3. Navigate to 'Database Indexes'.

Via the project

  1. Navigate to 'Projects'.
  2. Select the project.
  3. Navigate to 'Advanced' on the environment you want.
  4. Under 'Virtual Host', click 'Manage'.
  5. Navigate to 'Database Indexes'.

What the page shows

Cyberfusion asks the site which of the recommended indexes are missing, and lists them by table and column.

Nothing missing → the page says 'All recommended indexes are created. Nothing to do.'

The check runs against the live site, so the page always shows the database as it is right now.

What an index is

An index is a lookup table the database keeps next to your data. Without one, answering 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 where visitors notice the wait.

WordPress does not create all of these indexes when it installs. Cyberfusion does.

What 'Create Missing' does

It creates exactly the indexes in the list, and nothing else.

Cost: a small amount of disk space, which the database maintains from then on. Benefit: the affected queries get faster.

Sites that never need this

  • WordPress sites created through Core — the indexes are added as part of the install, before the site is handed to you.
  • WordPress installed automatically when you create a project environment.

The page is for the other cases: a site you migrated in from another host, or one set up on the server outside Core.

Finding every site that's missing them

The 'Database indexes created' health check flags sites with missing indexes per cluster. Its wrench button takes you straight to this page. See All about health checks.