• Resolved Go2People

    (@go2people)


    Hi there,

    We have a website that uses Yoast, and it seems to be slowing down the Page edit-form significantly.

    I’ve been performing some debug logging, specifically enabling SAVEQUERIES and checking those out, and it seems like otherwise normal queries that Yoast performs have been taking a long time. An example is this:

    SELECT posts.ID FROM posts WHERE 1=1 AND posts.post_author IN (1) AND posts.post_type = 'post' AND ((posts.post_status = 'publish' OR posts.post_status = 'acf-disabled')) ORDER BY posts.post_date DESC LIMIT 0, 1

    Ran through Yoast\WP\SEO\Helpers\Author_Archive_Helper->author_has_public_posts_wp according to the traceback in $wpdb->queries (note: I’ve removed our prefix for the sake of clarity).

    This is for all intents and purposes, a pretty mundane query that should not take a long time. However, $wpdb->queries reports the run time of this query averages at about 5 seconds, with spikes at just over 15 seconds. This is significantly more than I get when running this query through PMA (PHPMyAdmin), which takes about 0.05 seconds on average.

    A similarly uncomplicated query (although somewhat more verbose, to the extent that I’m not going to include the actual query in the post) that also takes upwards of 10 seconds to run is a query generated by. A similarly uncomplicated query (although somewhat more verbose, to the extent that I’m not going to include the actual query in the post) that also takes upwards of 10 seconds to run is a query generated by Yoast\WP\SEO\Premium\Integrations\Admin\Keyword_Integration->add_posts_for_focus_keyword . This query is also blazing fast when run through PMA.

    The third and final query that takes a long time to complete, is this one: SELECT object_id FROM ctjjpcp_yoast_indexable WHERE primary_focus_keyword = 'Adverteren' AND object_type = 'post' AND object_id != '19094' AND post_status != 'trash' LIMIT 2 which, again, is a pretty simple query that I wouldn’t expect to run for a significant amount of time, yet it takes almost 7 seconds to run at times.

    For the record, I’m using the plugins Yoast SEO, Yoast SEO Premium and Yoast SEO: News.

    I’ve checked to see if it might be unrelated to Yoast, but I don’t get these problems when I deactivate the Yoast plugin (and related add-ons) and it’s always those specific queries that are slow. Any idea what’s going on?

    • This topic was modified 1 year, 8 months ago by Go2People. Reason: me type not so good
Viewing 1 replies (of 1 total)
  • Thread Starter Go2People

    (@go2people)

    This issue was resolved – it was caused by a database cache-size being too small. Why this impacted Yoast, and only Yoast, is currently unclear to me but I don’t think this is strictly a Yoast issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Otherwise fast query slow on edit form’ is closed to new replies.