[buddypress-trac] [BuddyPress Trac] #5451: Groups query overhaul

buddypress-trac noreply at wordpress.org
Tue Sep 13 04:05:08 UTC 2016


#5451: Groups query overhaul
--------------------------+------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  high          |   Milestone:  2.7
Component:  Groups        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by boonebgorges):

 In [changeset:"11087"]:
 {{{
 #!CommitTicketReference repository="" revision="11087"
 Groups: Improve query efficiency for 'admins' and 'mods' properties of
 group objects.

 Previously, the 'admins' and 'mods' property of `BP_Groups_Group`
 objects were only populated when setting the 'populate_extras' flag.
 Even then, the query used to populate these properties was uncached,
 and required a join against a global table.

 This changeset reworks the way that the 'admins' and 'mods' properties
 are accessed and set. The properties are now marked `protected`, and
 are accessible by magic `__get()`. When requested, the cache for the
 both properties is set by a single pair of queries: one to fetch
 membership data from the BP table, and one to get user objects from
 WordPress. The BP table query is cached, and neither query takes place
 if the property is never accessed.

 This moves us a step closer to eliminating the `populate_extras` flag
 on `BP_Groups_Group` objects.

 See #5451.
 }}}

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


More information about the buddypress-trac mailing list