[wp-trac] [WordPress Trac] #24044: Add index to wp_options to aid/improve performance

WordPress Trac noreply at wordpress.org
Fri Jan 24 21:01:10 UTC 2014


#24044: Add index to wp_options to aid/improve performance
-----------------------------------------+------------------------------
 Reporter:  DanBUK                       |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Options and Meta             |     Version:  3.6
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:  performance
-----------------------------------------+------------------------------

Comment (by cliffseal):

 On an InnoDB database with about 615K rows in `wp_options`, here's what
 came across, running locally in MAMP. I started with an `autoload` index,
 removed it, and added it back.

 {{{
 SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';

 628 rows in set (0.01 sec)

 ALTER TABLE wp_options DROP INDEX autoload;
 SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';

 628 rows in set (2.30 sec)

 CREATE INDEX autoload ON wp_options(autoload, option_name);
 SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';

 628 rows in set (0.00 sec)
 }}}

 Does that help?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24044#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list