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

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 4 00:22:50 UTC 2012


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

 * keywords:  needs-patch => has-patch


Comment:

 `found_posts` is 0 by default, so I guess `set_found_posts()` can just
 return early if `! $this->posts` ([attachment:14426.patch]).

 [attachment:14426.2.patch] is a combined patch for #17066 and #21147 as
 well.

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


More information about the wp-trac mailing list