Bug #10147
closedbp-reply-by-email status check runs a slow MySQL query
0%
Description
Query Monitor is reporting a slow query on each pageload, which originates with RBE. See screenshot.
This appears to be at least somewhat due to the Cavalcade jobs table's schema. I wonder if we could add an index that would speed it up.
On RBE's end, do you think it's wise or possible to throttle the status checks? Once per pageload seems really frequent.
Files
Updated by Boone Gorges about 6 years ago
- Target version set to 1.14
Feel free to put in a different milestone as you see fit. Thank you!
Updated by Raymond Hoh about 6 years ago
- Status changed from New to Staged for Production Release
- Target version changed from 1.14 to 1.13.9
So I was looking at how WordPress schedules its hourly privacy export deletion job and they do it on 'init'
:
https://github.com/WordPress/WordPress/blob/4.9-branch/wp-includes/default-filters.php#L331
https://github.com/WordPress/WordPress/blob/4.9-branch/wp-includes/functions.php#L6026
RBE used to schedule its job on 'plugins_loaded'
.
Since WP's privacy export deletion job doesn't show up as a slow query in Query Monitor, I'm hoping moving RBE's check over to 'init'
will solve this problem.
Here's the changeset - https://github.com/cuny-academic-commons/cac/commit/951f54d9b112b930b722e59871c63dab967041bd
Let's keep an eye on this after the maintenance release to see if the slow query is gone.
Updated by Boone Gorges about 6 years ago
- File O2pMXkP.png O2pMXkP.png added
- Status changed from Staged for Production Release to Resolved
Thanks, Ray!
It seems that your change just delays the inevitable, because now WordPress is making the same query, beating RBE to the punch :) I'm not going to worry about this too much.