[buddypress-trac] [BuddyPress Trac] #7442: Use JOIN rather than Subquery on user search

buddypress-trac noreply at wordpress.org
Thu Aug 17 01:59:23 UTC 2017

#7442: Use JOIN rather than Subquery on user search
 Reporter:  brandonliles                  |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  3.0
Component:  Core                          |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch dev-feedback early  |

Comment (by boonebgorges):

 @brandonliles Thanks for the ticket and for your patches!

 For some background on your original suggestion: We intentionally
 converted these (and other) user-related queries to subqueries a number of
 years ago. BuddyPress must remain compatible with configurations where the
 `wp_users` table does not live in the same database - or even the same
 server - as `wp_bp_xprofile_data`. See eg

 Separating the subquery into a separate `$wpdb->get_col()` seems like an
 OK move to me. It'd be even better if we could use this opportunity to
 wrap a layer of caching around the search. Do you happen to have any
 benchmarks related to the performance improvements you've mentioned?

 I think we have sufficient test coverage for this kind of change. I can't
 think of a situation where the suggested change would break something that
 wouldn't be detected by the tests we've already got.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7442#comment:10>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list