Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/12/2017 08:46:10 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Queries: Use no_found_rows where relevant.

This prevents SQL_CALC_FOUND_ROWS usages in places where it is not used.

Fixes #2972.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/functions.php

    r6218 r6219  
    323323    $user_id   = bbp_get_user_id( $user_id );
    324324    $favorites = new WP_Query( array(
    325         'fields'     => 'ids',
    326         'post_type'  => bbp_get_topic_post_type(),
    327         'nopaging'   => true,
    328         'meta_query' => array( array(
     325        'fields'        => 'ids',
     326        'post_type'     => bbp_get_topic_post_type(),
     327        'nopaging'      => true,
     328        'no_found_rows' => true,
     329        'meta_query'    => array( array(
    329330            'key'     => '_bbp_favorite',
    330331            'value'   => $user_id,
     
    677678    $user_id       = bbp_get_user_id( $user_id );
    678679    $subscriptions = new WP_Query( array(
    679         'fields'     => 'ids',
    680         'post_type'  => bbp_get_forum_post_type(),
    681         'nopaging'   => true,
    682         'meta_query' => array( array(
     680        'fields'        => 'ids',
     681        'post_type'     => bbp_get_forum_post_type(),
     682        'nopaging'      => true,
     683        'no_found_rows' => true,
     684        'meta_query'    => array( array(
    683685            'key'     => '_bbp_subscription',
    684686            'value'   => $user_id,
     
    705707    $user_id       = bbp_get_user_id( $user_id );
    706708    $subscriptions = new WP_Query( array(
    707         'fields'     => 'ids',
    708         'post_type'  => bbp_get_topic_post_type(),
    709         'nopaging'   => true,
     709        'fields'        => 'ids',
     710        'post_type'     => bbp_get_topic_post_type(),
     711        'nopaging'      => true,
     712        'no_found_rows' => true,
    710713        'meta_query' => array( array(
    711714            'key'     => '_bbp_subscription',
Note: See TracChangeset for help on using the changeset viewer.