Opened 5 years ago
Closed 5 years ago
#46357 closed defect (bug) (fixed)
Don't prime site meta caches core functions
Reported by: | spacedmonkey | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 5.1.2 | Priority: | normal |
Severity: | normal | Version: | 5.1 |
Component: | Networks and Sites | Keywords: | has-patch fixed-major |
Focuses: | multisite, performance | Cc: |
Description
WP_Site_Query
and get_sites
are used in core functions to query the blogs table. As of 42836 site meta is in core and by default, primes the site meta caches on every WP_Site_Query
call. However, in many places it is extremely unlikely the site meta will be required or used. For performance reasons, these calls that do not require site meta should be changed.
Attachments (1)
Change History (10)
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
5 years ago
#4
@
5 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Future Release to 5.1.2
- Owner set to flixos90
- Status changed from new to assigned
Added to 5.1.2 and assigning to @flixos90 for merge. More details #46167
#5
@
5 years ago
I think this is phrased incorrectly a little bit - if this is an enhancement, it shouldn't go into 5.1.x. However, it appears to be related to the bug #46167. Can you clarify how this is related? If this ticket indeed fixes a fatal error, it should probably be a "bug", not an "enhancement".
#6
@
5 years ago
- Type changed from enhancement to defect (bug)
This is a bug and enhancement at the same time.
The fixes the issue in #46167 as the error happens in function get_site_by_path
that calls prime site meta before the check is loaded.
The two patches together work hand in hand, to make that queries are a not run on a none existing table, generating the error.
@flixos90 if 5.2 is landing soon, I am happy that it goes in that.
The following functions should be changed to not prime site meta caches
Maybes