[buddypress-trac] [BuddyPress Trac] #8688: BP_Groups_Group::get_total_member_count() is highly inefficient, and runs out of memory

buddypress-trac noreply at wordpress.org
Wed May 18 05:46:39 UTC 2022


#8688: BP_Groups_Group::get_total_member_count() is highly inefficient, and runs
out of memory
--------------------------+---------------------
 Reporter:  dd32          |       Owner:  imath
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:  10.3.0
Component:  Groups        |     Version:  10.0.0
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |
--------------------------+---------------------
Changes (by imath):

 * owner:  (none) => imath
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"13281" 13281]:
 {{{
 #!CommitTicketReference repository="" revision="13281"
 Improve group members count query performance

 [13103] introduced a change in 10.0.0 that can be very time consuming when
 a group has a lot of members.

 To keep the main improvements of the referenced commit (only refreshing
 group members count when a user joins or leaves a group) but optimize
 queries performance, we are introducing a new way to count group members
 in the `BP_Group_Member_Query`.

 We are also introducing a way to defer group members count when adding a
 batch of members to a group. Using `bp_groups_defer_group_members_count()`
 avoids to refresh the count each time a member of this batch is added. For
 more information about how to use this function, you can have a look at
 how BuddyPress is using it into `src/bp-groups/bp-groups-admin.php`.

 Props dd32, espellcaste

 Fixes #8688 (branch 10.0)
 }}}

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


More information about the buddypress-trac mailing list