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

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 30 05:25:21 UTC 2012


#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
--------------------------+-----------------------------
 Reporter:  mark-k        |       Owner:
     Type:  enhancement   |      Status:  closed
 Priority:  normal        |   Milestone:  Future Release
Component:  Optimization  |     Version:  3.0
 Severity:  normal        |  Resolution:  worksforme
 Keywords:  needs-patch   |
--------------------------+-----------------------------
Changes (by wonderboymusic):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 I no longer see the {{{SELECT FOUND_ROWS()}}} happening after empty query
 results

 {{{
 add_filter( 'query', function ( $sql ) { error_log( $sql ); return $sql; }
 );
 $q = new WP_Query( array( 'post__in' => array( 0 ) ) );
 }}}

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


More information about the wp-trac mailing list