Skip to content
Browse files

Schema: Add an index to `wp_options.autoload`.

Most sites will be unaffected by this change, but those with a large number of rows in `wp_options`, only a small number of which have `autoload` set, will see a significant performance improvement.

Sites with a large number of rows in `wp_options`, with many of them having `autoload` set will unfortunately see a performance penalty on top of the already very slow queries they're running, but this should be the minority of cases.

Props DanBUK.
Fixes #24044.

git-svn-id: 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
pento committed Aug 15, 2019
1 parent e982455 commit 9c3fb72719a9e5121131af1efe832738717b6587
Showing with 3 additions and 2 deletions.
  1. +2 −1 src/wp-admin/includes/schema.php
  2. +1 −1 src/wp-includes/version.php
@@ -144,7 +144,8 @@ function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
option_value longtext NOT NULL,
autoload varchar(20) NOT NULL default 'yes',
PRIMARY KEY (option_id),
UNIQUE KEY option_name (option_name)
UNIQUE KEY option_name (option_name),
KEY autoload (autoload)
) $charset_collate;
CREATE TABLE $wpdb->postmeta (
meta_id bigint(20) unsigned NOT NULL auto_increment,
@@ -20,7 +20,7 @@
* @global int $wp_db_version
$wp_db_version = 45744;
$wp_db_version = 45805;
* Holds the TinyMCE version

0 comments on commit 9c3fb72

Please sign in to comment.
You can’t perform that action at this time.