SQL_CALC_FOUND_ROWS Performance Issue
-
We have a webiste with +- 1000 posts and +- 11000 postmeta entries. We get +- 20K – 40K visitors a day.
We’ve noticed a problem with SQL using up all resources on the VPS till eventually crashing.
After some investigation we’ve found the following query causing the issue.
Copy to tmp table – SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta
The query doesn’t seem to execute at specific times but I’ve noticed that when it starts it can eventually have 10+ lines of the same query in the MySQL process list and this is when the database crashes.
We’ve activated the query cache = 512MB and increased the temp_table_size to 512MB in my.cnf. This improved it but the problem eventually returns.
I’ve read that there are some very large WordPress sites that are experience similar issues but they have 100K + posts… https://www.ads-software.com/support/topic/slow-queries-sql_calc_found_rows-bringing-down-site?replies=25
I am not a MySQL or WordPress Code expert but I was hoping someone can help me or guide me in the right direction getting this issue resolved.
I’ve already disabled most of the plugins but the problem still happens which indicates that the problem might be with WordPress.
Here is a post I found but I am not sure if this will resolve the issue or how to apply the code mentioned in the article. https://www.ads-software.com/support/topic/select-sql_calc_found_rows-causing-crashes?replies=3
Thank you in advance.
Jon.
- The topic ‘SQL_CALC_FOUND_ROWS Performance Issue’ is closed to new replies.