From c80a049db3eb5a0713c57f0ee3f4260ca1f29041 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 9 Jul 2013 19:14:33 +0000 Subject: [PATCH] In populate_options(), only query the option names we are checking against. No need to load the entire table into memory. props leewillis77. fixes #24620. git-svn-id: http://core.svn.wordpress.org/trunk@24614 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 1c61ded04d..162651a418 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -494,7 +494,8 @@ function populate_options() { // Set autoload to no for these options $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys', 'uninstall_plugins' ); - $existing_options = $wpdb->get_col("SELECT option_name FROM $wpdb->options"); + $keys = "'" . implode( "', '", array_keys( $options ) ) . "'"; + $existing_options = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name in ( $keys )" ); $insert = ''; foreach ( $options as $option => $value ) {