[wp-hackers] Recent Comments Plugins.
Matt Mullenweg
m at mullenweg.com
Wed Jul 20 18:10:00 GMT 2005
Roy Schestowitz wrote:
> That's quite true, but supervision of such initiative takes a lot of
> testers who
> congragate a a selection of 'approved' plug-ins. You then face the issue of
> having to review and hammer on any plug-in that an anonymous, obscure
> developer
> submits to you.
However some are just badly written as to cause undue load, and we
should remove or patch those plugins, at least in the repository. The
one in the previous message gets slower with every additional comment.
It's probably a case where two queries would be better than one:
mysql> EXPLAIN SELECT wp_posts . * , MAX( comment_date ) AS max_comment_date
-> FROM wp_comments, wp_posts
WHERE wp_posts.post_date <= '2005-07-19 13:38:31'
-> WHERE wp_posts.post_date <= '2005-07-19 13:38:31'
-> AND (
-> wp_posts.post_status = 'publish'
-> OR wp_posts.post_status = 'sticky'
-> )
-> AND wp_posts.post_password = ''
-> AND wp_posts.ID = wp_comments.comment_post_ID
-> AND wp_comments.comment_approved = '1'
-> GROUP BY wp_posts.ID
-> ORDER BY max_comment_date DESC
-> LIMIT 0 , 20;
+-------------+--------+----------------------------------+------------------+---------+-----------------------------+-------+----------------------------------------------+
| table | type | possible_keys | key
| key_len | ref | rows | Extra
|
+-------------+--------+----------------------------------+------------------+---------+-----------------------------+-------+----------------------------------------------+
| wp_comments | ref | comment_approved,comment_post_ID |
comment_approved | 1 | const | 11676 | Using
where; Using temporary; Using filesort |
| wp_posts | eq_ref | PRIMARY,post_date,post_status | PRIMARY
| 8 | wp_comments.comment_post_ID | 1 | Using where
|
+-------------+--------+----------------------------------+------------------+---------+-----------------------------+-------+----------------------------------------------+
--
Matt Mullenweg
http://photomatt.net | http://wordpress.org
http://pingomatic.com | http://cnet.com
More information about the wp-hackers
mailing list