Make WordPress Core

Changeset 30029


Ignore:
Timestamp:
10/26/2014 10:09:46 PM (10 years ago)
Author:
jeremyfelt
Message:

Optimize site query when performing network database upgrades

We only use blog_id from the query, so we don't need a wildcard.

props marcosf
Fixes #30097

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/upgrade.php

    r28500 r30029  
    5353        }
    5454
    55         $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
     55        $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
    5656        if ( empty( $blogs ) ) {
    5757            echo '<p>' . __( 'All done!' ) . '</p>';
Note: See TracChangeset for help on using the changeset viewer.