[buddypress-trac] [BuddyPress] #3972: Database query needs optimization - BP_Core_User->get_users

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Mon Feb 6 09:44:13 UTC 2012


#3972: Database query needs optimization - BP_Core_User->get_users
----------------------------+-----------------------------
 Reporter:  arpit.tambi.in  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  Core            |     Version:  1.5.3
 Severity:  normal          |  Resolution:
 Keywords:                  |
----------------------------+-----------------------------

Comment (by arpit.tambi.in):

 Yes you are right, I am not using a plugin, but a simple bp_has_members
 loop in my theme. I wanted to add a "Friend Suggestions" like feature on
 the sidebar, so I just added following to the sidebar -

 {{{
 bp_has_members( array(
                 'type'                    => 'newest',
                 'per_page'        => 5,
                 'max'             => 5,
                 'search_terms'    => bp_get_member_profile_data(array(
 'field' => 'Country', 'user_id' => bp_displayed_user_id())), // Pass
 search_terms to filter users by their profile data
         )
 }}}

 This code tries to find profiles with same country as the displayed user.

 My wp_usermeta table has about 1M rows. wp_users has about 60K rows and
 wp_bp_xprofile_data has about 65K rows.

 I also want to mention unusually high status values from mysql server -
 Handler_read_rnd        62.5 M
 Handler_read_rnd_next   261.5 M

 I am not sure if its related to buddypress but still may be of some help.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3972#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list