[buddypress-trac] [BuddyPress] #4060: Improve performance of BP_Core_User::get_users()

buddypress-trac noreply at wordpress.org
Wed Nov 14 13:47:33 UTC 2012


#4060: Improve performance of BP_Core_User::get_users()
-------------------------------------+--------------------
 Reporter:  shanebp                  |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  highest                  |   Milestone:  1.7
Component:  Members                  |     Version:  1.2.9
 Severity:  critical                 |  Resolution:
 Keywords:  needs-testing has-patch  |
-------------------------------------+--------------------

Comment (by DJPaul):

 Friends>Requests query is still incorrect.

 BP-Default/theme compat. use bp_has_members('include=1,2,3,..') in the
 Requests template. BP_User_Query, because we're doing this on a user page,
 picks up the 'user' parameter which is automatically set somewhere, and
 appends the user's existing friends, too (which is pointless for the
 request page). The SQL looks like this:

 `array(5) {
   ["select"]=>
   string(42) "SELECT DISTINCT u.ID as id FROM wp_users u"
   ["where"]=>
   array(2) {
     [0]=>
     string(17) "u.ID IN (26,24,9)"
     [1]=>
     string(24) "u.ID IN (8,25,12,3,2,23)"
   }
   ["orderby"]=>
   string(23) "ORDER BY u.display_name"
   ["order"]=>
   string(3) "ASC"
   ["limit"]=>
   string(11) "LIMIT 0, 20"
 }`

 I am assuming WP_User_Query joins the WHERE conditions together, so we end
 up with an impossible-to-match query.

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


More information about the buddypress-trac mailing list