[buddypress-trac] [BuddyPress Trac] #5303: DISTINCT causing poor performance on user queries

buddypress-trac noreply at wordpress.org
Thu Jan 30 11:52:14 UTC 2014


#5303: DISTINCT causing poor performance on user queries
-----------------------------+------------------------------
 Reporter:  johnjamesjacoby  |       Owner:  johnjamesjacoby
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  2.0
Component:  Core             |     Version:  1.2
 Severity:  normal           |  Resolution:
 Keywords:  early            |
-----------------------------+------------------------------

Comment (by lenasterg):

 Sorry, about the false-positive.

 Is it the same case at /bp-groups/bp-groups-classes.php on line 2033 ?

 {{{
 $group_sql = $wpdb->prepare( "SELECT DISTINCT group_id FROM
 {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1
 AND is_banned = 0{$pag_sql}", $user_id );

 }}}
 and line 2034

 {{{
 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT
 group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND
 is_confirmed = 1 AND is_banned = 0", $user_id ) );
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5303#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list