[wp-trac] [WordPress Trac] #6770: large number of queries in the
pages management page
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 18 12:10:05 GMT 2008
#6770: large number of queries in the pages management page
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: Optimization | Version: 2.5
Severity: minor | Keywords:
-------------------------------+--------------------------------------------
On a site with lots of static pages, you get all sorts of queries like:
{{{
array(3) {
[0]=>
string(87) "SELECT COUNT(*) FROM wp_comments WHERE comment_post_ID =
553 AND comment_approved = '0'"
[1]=>
float(0.00033998489379883)
[2]=>
string(24) "get_pending_comments_num"
}}}
they could be replaced by a single query, such as:
{{{
SELECT comment_post_ID, COUNT(comment_ID) FROM wp_comments WHERE
comment_post_ID = IN ( post ID list ) AND comment_approved = '0' GROUP BY
comment_post_ID
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/6770>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list