This query shows up all the time in my slow logs, and I’m just confused about how WP can have such slow queries in it?
SELECT DISTINCT *
WHERE 1 =1
AND post_date_gmt <= '2005-07-07 13:07:51'
post_status = "S"
AND post_status != "w"
GROUP BY wp_posts.ID
ORDER BY post_date DESC
LIMIT 0 , 40
I have a clean WP 2.0.3 install, with no plugings.
The above query regularly takes 100s of seconds to run! Although a regular run when the db is fast seems rather fast (0.0022s). It may be that the query gets slow because of other reasons.
When I run an explain, mysql uses the post_status key, but reports under extra:
Using where; Using temporary; Using filesort
Not so good I believe?
Perhaps comment spam?