-
Notifications
You must be signed in to change notification settings - Fork 907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yoast\W\S\A\I\Abstract_Indexing_Action->get_limited_unindexed_count() slow query #18065
Comments
Hi,
|
Same issue here. |
If you experience this issue on every admin pageload I would first advise to check if your transients are set up properly. This query should only run every 15 minutes because it always stores a transient for that period of time. Having said that, I do notice a query time of 4+ seconds on about 25000 posts, but that is nowhere near the 369 seconds described. We're still investigating this for now. |
Hi @Djennez, I can confirm this is not happening on every pageload but this is still an issue. |
I've converted this issue to an internal issues over here. However, it will probably not get picked up any time soon. |
This query causes annoyances on our wp-admin and makes the plugins page load for 60s+. Why does it run on this page at all? If it needs to run periodically, stick it into wp cron, but please, don't make it run synchronously on pages that have nothing to do with Yoast. |
I was able to get very modest gains for the inner query by adding this index:
With yoast's own indexes, the inner SELECT runs with a full table scan. |
Any updates please? This is still painfully slow. Why does it need to run on the plugins list page |
Anyone? @Djennez This behavior continues every time I visit the plugins page after a while. |
Here's a proposed change to the slow query. It is returning the same exact results for me, except in 0.3s, which is 2 orders of magnitude faster than the current query.
Here's the current slow query:
|
While I'm on the subject of poor performance caused by Yoast, this query, which loads on the Yoast dashboard, is far worse and is taking 45 seconds currently:
It can be rewritten like so:
The rewritten query runs in 7.5s, much faster, albeit still quite slowly. |
Hello all, Thank you for making suggestions on how we can improve our performance! Is there anything else you could supply us with in your hosting setup that might have an impact on the query performance? |
Hello all, We are closing this issue due to lack of interaction. If any of you run into this again, or have more information please let us know. |
Hi @thijsoo, I'm still able to reproduce this issue on Yoast 22.5, the latest version. Please reopen the ticket. What sort of info are you looking for? Some numbers from our setup:
The
But regardless, this query should only run from cron and shouldn't massively slow down the plugins page (why is it running here at all?), the dashboard page, or the Yoast settings page. At best, if cron isn't viable, run it via Ajax, use a cached value and refresh it via Ajax, or avoid using it altogether. |
@thijsoo Please reopen. |
Please give us a description of what happened.
On a website with a lot of content the
Yoast\W\S\A\I\Abstract_Indexing_Action->get_limited_unindexed_count()
function triggers a very slow SQL query?The following query is very slow:
which takes 369 seconds.
The
wp_yoast_indexable
table contains ~20000 rows.The
wp_posts
table contains ~27000 rows.All posts are indexed and the above SQL query returns 0 entries.
Can you reproduce?
Used versions
The text was updated successfully, but these errors were encountered: