[wp-trac] [WordPress Trac] #16846: wp_dashboard_recent_comments can generate hundreds of queries

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 14 11:11:08 UTC 2011


#16846: wp_dashboard_recent_comments can generate hundreds of queries
---------------------------------+-----------------------------
 Reporter:  ocean90              |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  high                 |   Milestone:  Future Release
Component:  Comments             |     Version:  3.0
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.2-early  |
---------------------------------+-----------------------------
Changes (by ocean90):

 * keywords:  has-patch 3.2-early reporter-feedback => has-patch 3.2-early


Comment:

 Site with 5,439 comments.

 Number of queries without the fix:
  - Default (5 comments): 46
  - 4 comments: 156
  - 3 comments: 155
  - 2 comments: 154
  - 1 comment: 153
  - 0 comments: 152 (Yeah, it's possible, but you will get the message ''No
 comments yet.'')
  - 10 comments: 51

 The query; '''X''' is from 0 to 5500, intervall is 50.

 SELECT * FROM wp_comments c LEFT JOIN wp_posts p ON c.comment_post_ID =
 p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT
 '''X''', 50

 [[BR]]

 Number of queries with the fix:
  - Default (5 comments): 46
  - 4 comments: 46
  - 3 comments: 45
  - 2 comments: 44
  - 1 comment: 43
  - 0 comments: 41
  - 10 comments: 51

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16846#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list