Opened 3 months ago
Closed 3 months ago
#9203 closed enhancement (invalid)
Cache `BP_Groups_Member::total_group_count()`
Reported by: | espellcaste | Owned by: | espellcaste |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Performance | Keywords: | |
Cc: |
Description
For large communities, this method runs an expensive query that's uncached.
I noticed slow query notices while visiting the https://site.com/groups/
page with a 50k groups dataset.
We should cache it.
Change History (6)
#1
@
3 months ago
- Component changed from Groups to Performance
- Type changed from defect (bug) to enhancement
#3
@
3 months ago
Thanks! I'll start by confirming why we are not using groups_total_groups_for_user
instead. I can see we are calling BP_Groups_Member::total_group_count
directly.
Thanks for the feedback.
#6
@
3 months ago
- Keywords needs-patch removed
- Milestone 15.0.0 deleted
- Resolution set to invalid
- Status changed from assigned to closed
Turned out the template is using the right function. The problem was that I was not using an object cache service locally, so the request was going to the db every time.
After adding an object cache service, the cache kicked in and the warning was gone.
Let's resolve this as invalid.
Hi Mate,
Regards