I'm working on a larger WordPress site and trying to troubleshoot why my site is so slow. I've installed W3 Total Cache and have run multiple page speed and plugin tests with no luck.
What's strange is that my pages load within 2 - 3 seconds but the initial server connection ("waiting for server") takes about 10 - 15 seconds.
I looked into /var/log/mysqlslow.log and found massive queries like this one:
# Time: 131107 16:47:15 # User@Host: username/pw @ localhost  # Query_time: 13.970453 Lock_time: 0.310980 Rows_sent: 3 Rows_examined: 16925 SET timestamp=1383871635; SELECT distinct ID FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE post_type = 'post' AND post_status = 'publish' AND ID<>1000040979 AND ID IN ('30460', '49942', ...
The IDs in parenthesis go on for pages and pages. They are incredibly long. Does anyone have a clue what's happening here and why these queries are so long?