From 9c3fb72719a9e5121131af1efe832738717b6587 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 15 Aug 2019 07:12:04 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@45805 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/schema.php | 3 ++- src/wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index 1511f27f39..92fd6d6619 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -144,7 +144,8 @@ CREATE TABLE $wpdb->options ( 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, diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index fada58f415..350c2676d7 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -20,7 +20,7 @@ $wp_version = '5.3-alpha-45282-src'; * * @global int $wp_db_version */ -$wp_db_version = 45744; +$wp_db_version = 45805; /** * Holds the TinyMCE version