[wp-trac] [WordPress Trac] #3170: Sites installed with 2.0 and newer do not have the post_status index. This slows WP sites.

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 26 13:36:47 GMT 2006


#3170: Sites installed with 2.0 and newer do not have the post_status index. This
slows WP sites.
-------------------------+--------------------------------------------------
 Reporter:  BrianLayman  |       Owner:  anonymous     
     Type:  defect       |      Status:  new           
 Priority:  high         |   Milestone:  2.0.5         
Component:  General      |     Version:  2.0           
 Severity:  normal       |    Keywords:  Database index
-------------------------+--------------------------------------------------
 If you create a site from the 2.04 install and it only has the
 PRIMARY and post_name indices/indexes in the posts table.

 According to upgrade-schema.php, you are only suppose to have KEY and
 post_name:
 CREATE TABLE $wpdb->posts (
   [A BUNCH OF FIELDS]
   PRIMARY KEY  (ID),
   KEY post_name (post_name)
 );


 However, in upgrade-functions.php, the 'post_status' index is added as
 part of function upgrade_101().
         // Clean up indices, add a few
         add_clean_index($wpdb->posts, 'post_name');
         add_clean_index($wpdb->posts, 'post_status');
         add_clean_index($wpdb->categories, 'category_nicename');
         add_clean_index($wpdb->comments, 'comment_approved');
         add_clean_index($wpdb->comments, 'comment_post_ID');
         add_clean_index($wpdb->links , 'link_category');
         add_clean_index($wpdb->links , 'link_visible');

 It seems upgrade_101 is not called when a new DB is create because the
 version is already 3440.

 All of those other indices have been moved over to the schema file but
 post_status has not.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3170>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list