• Resolved januzi_pl

    (@januzi_pl)


    Hello, I’ve been doing some maintenance jobs on the server and I’ve checked what mariadb has to say about the queries that are being run by WordPress and I’ve found that one:
    # Query_time: 1.928526 Lock_time: 0.000064 Rows_sent: 50 Rows_examined: 438401
    SELECT
    p.ID, p.post_type, p.post_content, p.post_excerpt, p.post_modified_gmt
    FROM wp_posts as p
    LEFT JOIN wp_aioseo_posts as ap ON ap.post_id = p.ID
    WHERE 1 = 1 AND
    ( ap.id IS NULL OR p.post_modified_gmt > ap.video_scan_date OR ap.image_scan_date IS NULL )
    AND p.post_status = ‘publish’
    AND p.post_type IN ( ‘post’, ‘page’, ‘attachment’, ‘forum’, ‘topic’, ‘reply’, ‘reklamy’, ‘reklamy2’ )
    LIMIT 50;

    If that query is populating the aioseo_posts table, then would you be so kind and add “order by p.ID” or something like that to that query? Right now it’s in the top10 by the pt-query-digest.

    • This topic was modified 4 years, 2 months ago by januzi_pl.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @januzi_pl,

    We’ve optimized that query in the next update, so hopefully that will have a positive impact on your site. The update should be out next week.

    Can you let me know what impact it had after you’ve updated and let it run for a while?

    – Arnaud

    Thread Starter januzi_pl

    (@januzi_pl)

    Hello

    Sure thing, I’ll check it out and let you know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pretty slow query’ is closed to new replies.