At my own host, there is a folder for “mysql_slow_queries” containing logs inside a “tmp” folder just outside my root folder, and there is where I have been looking at the queries that had been slowing things down and even causing my account to be throttled at times.
I’ve had a bad theme use the wrong hook and create dozens of unnecessary database queries, so you might try a default theme like Twentytwelve or Twentythirteen. I also had great luck with DB Cache Reloaded Fix where the standard caching plugins weren’t improving performance as much as I’d hoped.
Thanks leejosepho. I’ve found this same folder on my server and narrowed it down to a single query that is taking over 5 seconds to complete.
It looks like the SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND wp_posts.ID IN
This query is scanning our wp_posts table, which has over a 1,000 posts in it….
Any idea on what this query is for and how to lower the time on it?
So far, I have only been deleting leftover queries related to plugins I no longer use, but I think the deal there has to do with adding or modifying a database table related to a needed query that happens to be running slow…and I have actually hired the individual who told me about all of that to take a closer look. Also, and if I remember correctly, anything you find in that log is considered slow even if it only shows taking a small fraction of a second.
I do not know enough to explain the details of what I have been doing about slow queries and cleaning up my databases, but here are the plugins that are helping to make that possible:
http://ww.wp.xz.cn/plugins/search.php?q=WP-DBManager
note: Always begin with a backup, then take an overall look.
http://ww.wp.xz.cn/plugins/search.php?q=WP+Clean+Up
note: Be cautious of deleting drafts you might actually want to keep.
http://ww.wp.xz.cn/plugins/search.php?q=WP+CleanFix
note: This one found things I had not seen anywhere else.
http://ww.wp.xz.cn/plugins/search.php?q=Options+Optimizer
note: Be sure to not modify anything you actually still need.
PS: I have also found this one, but I have yet to know what to actually do with its results…
http://ww.wp.xz.cn/plugins/search.php?q=Debug+Queries