WP Database overload
-
Hello, I recently had an overload of my database, here’s one of the queries that seemed to have caused that, it’s the one that took the longest (7671 sec)…
Time: 40% (7671 sec)
Amount: 28% (228 queries)
Rows Examined/Sent: 22126835 / 1402
Avg. Query Exec/Lock Time: 33 / 0 sec.
Used databases: [database_name]
Query example: use database_name; 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.post_date DESC LIMIT 0, 10;As far as I understand, it’s the long time (7671 sec) that caused the overload, or is it rather the amount of queries (228) that’s the faulty?
Anyway, here and in some of the other queries just like in this one, there is the SELECT SQL_CALC_FOUND_ROWS function, I read a bit about it and found out that it can slow down queries, could anybody please tell me when does wordpress run such a query with this function, in the database – I mean what action you need to do in your wordpress site – like search something or maybe edit a post, etc…Here’s another one just for reference (second longest):
Time: 14% (2764 sec)
Amount: 14% (113 queries)
Rows Examined/Sent: 15465614 / 1130
Avg. Query Exec/Lock Time: 24 / 0 sec.
Used databases: [database_name]
Query example: use database_name; SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (‘9’) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10;Same question here; when does wordpress run such a query in the database, what exactley does it return? Also – SQL_CALC_FOUND_ROWS is present here as well…
Thanks a bunch!
- The topic ‘WP Database overload’ is closed to new replies.