[wp-trac] [WordPress Trac] #19903: wp_count_comments() and get_comments_count() both do SQL queries

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 27 02:16:30 UTC 2012


#19903: wp_count_comments() and get_comments_count() both do SQL queries
-------------------------+--------------------
 Reporter:  markjaquith  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.4
Component:  Comments     |     Version:  3.3.1
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+--------------------

Comment (by nacin):

 Replying to [comment:5 markjaquith]:
 > Maybe. Unless people are using it to get "hot" data from the database.
 The cached counts might sometimes be wrong.

 If getting hot data from the database is a valid use case, then we
 shouldn't deprecate it, even if the function isn't used by core.
 Otherwise, we should either ensure that the cache is invalidated, modify
 any cached data directly when wp_update_comment_count() is called, or
 decide that the non-persistence of the counts cache group is enough to
 ensure that the data is warm enough.

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


More information about the wp-trac mailing list