[wp-testers] Too slow...

Paolo Gabrielli paolo.gabrielli at gmail.com
Sun Jan 22 14:20:01 GMT 2006


Hi,
I'm porting a custom CMS to WP2(.0.1-alpha) for a small local on-line
newspaper, but I've imported nearly 15000 posts, 40 category (not yet
imported 600 users and 800 comments) but I've noticed, thanks to
Jerome's Query Diagnostics plugin, that the queries that pull data
from wp_posts took TOO much time.

The first and most important is
"SELECT DISTINCT * FROM wp_posts  WHERE 1=1 AND post_date_gmt <=
'2006-01-22 13:40:59' AND (post_status = "publish" OR post_author = 1
AND post_status != 'draft' AND post_status != 'static') AND
post_status != "attachment" GROUP BY  wp_posts.ID  ORDER BY post_date
DESC LIMIT 0, 10"
(7 seconds in the test server 900Mhz and MySQL 4.1)

The others' wp_posts' queries are
"SELECT COUNT(DISTINCT ID) FROM wp_posts  WHERE 1=1 AND post_date_gmt
<= '2006-01-22 14:05:59' AND (post_status = "publish" OR post_author =
1 AND post_status != 'draft' AND post_status != 'static') AND
post_status != "attachment" "
and
"SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS
`month`, count(ID) as posts FROM wp_posts WHERE post_date <
'2006-01-22 15:05:39' AND post_date != '0000-00-00 00:00:00' AND
post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date)
ORDER BY post_date DESC"
(0.45s each of them)

This "problem" is only on the front page, but I think is relevant.
Is there anyone with an installation with so many posts? If so, what
have you done? Or this only belongs to me? At a first look I'm going
to simplify that ugly query but is very complicated to have it done
not break something...

Thank you,
Paolo


More information about the wp-testers mailing list