[wp-trac] [WordPress Trac] #14426: unneeded "SELECT FOUND_ROWS()" when no posts are found

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 11 04:11:53 UTC 2012


#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
-------------------------+-----------------------
 Reporter:  mark-k       |       Owner:  ryan
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.5
Component:  Query        |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------
Changes (by nacin):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 [21928] broke [http://plugins.svn.wordpress.org/advanced-caching/trunk
 /advanced-caching.php the advanced caching plugin]. That's an older
 version than what they run on WP.com, but you can see that the
 found_posts_query is avoided if the query is cached, and then on the
 the_posts hook, the posts are populated. Right after the_posts, core sets
 post_count.

 If we're going to avoid setting found_posts if no posts are found, then we
 may need to re-adjust found_posts when we adjust post_count after
 the_posts. If we can't figure out the right logic, we should just remove
 `|| ! $this->posts` for now and come back to it in 3.6.

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


More information about the wp-trac mailing list