Changeset 6825

Show
Ignore:
Timestamp:
02/13/08 19:15:30 (9 months ago)
Author:
ryan
Message:

Add comment_date_gmt key to comments table. Optimize _wp_get_comment_list() query. fixes #5785

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/schema.php

    r6780 r6825  
    5454  KEY comment_approved (comment_approved), 
    5555  KEY comment_post_ID (comment_post_ID), 
    56   KEY comment_approved_date_gmt (comment_approved,comment_date_gmt) 
     56  KEY comment_approved_date_gmt (comment_approved,comment_date_gmt), 
     57  KEY comment_date_gmt (comment_date_gmt) 
    5758) $charset_collate; 
    5859CREATE TABLE $wpdb->links ( 
  • trunk/wp-admin/includes/template.php

    r6804 r6825  
    557557            comment_content LIKE ('%$s%') ) AND 
    558558            comment_approved != 'spam' 
    559             ORDER BY comment_date DESC LIMIT $start, $num"); 
     559            ORDER BY comment_date_gmt DESC LIMIT $start, $num"); 
    560560    } else { 
    561         $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date DESC LIMIT $start, $num" ); 
     561        $comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE comment_approved = '0' OR comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $start, $num" ); 
    562562    } 
    563563 
  • trunk/wp-includes/version.php

    r6748 r6825  
    1717 * @global int $wp_db_version 
    1818 */ 
    19 $wp_db_version = 6748
     19$wp_db_version = 6825
    2020 
    2121?>