Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #24044, comment 34


Ignore:
Timestamp:
07/01/2014 07:05:05 AM (11 years ago)
Author:
DrewAPicture
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24044, comment 34

    initial v1  
    22
    33Before index
     4{{{
    45mysql> explain select option_name, option_value from wp_options where autoload = 'yes';
    56+----+-------------+------------+------+---------------+------+---------+------+--------+-------------+
     
    89|  1 | SIMPLE      | wp_options | ALL  | NULL          | NULL | NULL    | NULL | 807663 | Using where |
    910+----+-------------+------------+------+---------------+------+---------+------+--------+-------------+
     11}}}
    1012
    1113After index:
     14{{{
    1215mysql> explain select option_name, option_value from wp_options where autoload = 'yes';
    1316+----+-------------+------------+------+---------------+----------+---------+-------+------+-----------------------+
     
    1619|  1 | SIMPLE      | wp_options | ref  | autoload      | autoload | 62      | const |  265 | Using index condition |
    1720+----+-------------+------------+------+---------------+----------+---------+-------+------+-----------------------+
     21}}}
    1822
    1923We are talking about reducing query time by 1 second in this instance.  As the average size of wp_options grows and grows its a nice low cost index to add that protects people from plugins that use wp_options as a temp data store.