• The delete SQL command is quite slow on my system. Running this query directly on the DB is also very slow. It doesn’t appear to be missing any indexes. Any ideas?

    DELETE FROM wp_popularpostsdatacache WHERE id IN (
    SELECT c.id
    FROM (
    SELECT id
    FROM wp_popularpostsdatacache
    GROUP BY id
    )c
    LEFT JOIN wp_posts p ON c.id = p.ID
    WHERE p.ID IS NULL
    OR p.post_status =  'trash'
    )

    This query is also always showing up in my New Relic “Most time consuming” log:

    INSERT INTO wp_popularpostsdatacache (id, day, day_no_time) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE pageviews = pageviews + ?, day = ?, day_no_time = ?;

    http://wordpress.org/plugins/wordpress-popular-posts/

Viewing 1 replies (of 1 total)
  • Thread Starter fatpat76

    (@fatpat76)

    Hey there, any idea if this can be improved? Our site slows to a crawl when this DELETE operation runs.

    Can it be triggered to run during certain times of the day instead?

Viewing 1 replies (of 1 total)
  • The topic ‘Delete from data cache operation is slow’ is closed to new replies.