Heavy WordPress MySQL query, please help me find it and optimise it

I have a wordpress website up and running that is reasonably popular but over the last couple of days my performance has degraded terribly.

I have installed Jet Profiler and have been monitoring the MySQL database to see if I can find something wrong and this one query is consistently the worst offender.

Read More
SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.ID ASC LIMIT 0, 1

My first guess would be to remove the SQL_CALC_FOUND_ROWS function and change the * to be specific fields only but I can’t find what is calling this query.

How would I find out which php file is calling this?

Related posts

Leave a Reply

3 comments

  1. The final solution was that a plug in called TDO Mini Forms was badly coded and destroying my database.

    So if you ever have this problem and have that plug in I strongly recommend removing it. It doesn’t appear to even exist as a valid option in the plugin database anymore