[wp-hackers] Improving WordPress' Performance WAS Changing MySQL minimum version

Matt Mullenweg m at mullenweg.com
Fri Dec 1 07:47:07 GMT 2006


Komra Moriko wrote:
> CREATE INDEX cat_name ON wp_categories (cat_name);
> CREATE INDEX post_date ON wp_posts (post_date);
> CREATE INDEX post_date_gmt ON wp_posts (post_date_gmt);
> CREATE INDEX post_status ON wp_posts (post_status);

Just a note for those following along at home, MySQL can only use one 
index for any given query. Even if an index exists, it will be ignored 
by the optimizer if there is a more primary one available, or depending 
on the table size it'll just do a scan. To keep it to the indicies you 
need to do multi-field ones, like we added in 2.1.

-- 
Matt Mullenweg
  http://photomatt.net | http://wordpress.org
http://automattic.com | http://akismet.com


More information about the wp-hackers mailing list