You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Yoast sitemaps does a pretty gnarly query for author sitemaps. This is because the sitemap also has to exclude anyone with the wpseo_noindex_author == on user-meta; what's more it's also ordering by another meta key value _yoast_wpseo_profile_updated.
On large sites this query can take more than 160 seconds.
The text was updated successfully, but these errors were encountered:
Using Yoast SEO's XML sitemaps (and core, more on that below) we are seeing timeouts at /sitemap_index.xml or /wp-sitemap.xml. This is with a database with around 300K published posts, and 750K objects in wp_posts. I also tested disabling Yoast SEO's sitemaps and used Core's sitemaps too. I have X-Ray traces for both:
Yoast (330 seconds) Core (117 seconds)
They seems to be slow for slightly different reasons, both due to slow MySQL queries.
Yoast:
SELECT
post_type,
MAX(post_modified_gmt) ASdateFROM
wp_posts
WHERE
post_status IN ('publish', 'inherit')
AND post_type IN ('post', 'page', 'attachment', 'developing_story')
GROUP BY
post_type
ORDER BYdateDESC
This takes about 310 seconds, so the majority of the request. This is to get the latest update time for each public post. In theory this looks cache-able, or even shift those to stored values in an option or something. This is slow because there's no index on post_modified_gmt. If instead this query were to use post_date (not the same functionality I know), then the query only takes 1.5 seconds.
This appears to be from the sitemap for users. That query was actually already discussed in #5792, which I wrote an optimization for, so it could be if we incorporate that optimization into roles-to-taxonomy then Core sitemaps will fix. Also, turning off the users sitemap could be an option.
Currently Yoast sitemaps does a pretty gnarly query for author sitemaps. This is because the sitemap also has to exclude anyone with the
wpseo_noindex_author == on
user-meta; what's more it's also ordering by another meta key value_yoast_wpseo_profile_updated
.On large sites this query can take more than 160 seconds.
The text was updated successfully, but these errors were encountered: