[wp-trac] [WordPress Trac] #14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 12 15:04:42 UTC 2010
#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
--------------------------+-------------------------------------------------
Reporter: mark-k | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.1
Component: Optimization | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Changes (by tmoorewp):
* cc: tim@… (added)
Comment:
Is this issue already fixed? I'm seeing the following in my wp-
includes/query.php file:
{{{
if ( !$q['no_found_rows'] && !empty($limits) ) {
$found_posts_query = apply_filters_ref_array(
'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) );
$this->found_posts = $wpdb->get_var(
$found_posts_query );
$this->found_posts = apply_filters_ref_array(
'found_posts', array( $this->found_posts, &$this ) );
$this->max_num_pages = ceil($this->found_posts /
$q['posts_per_page']);
}
}}}
The additional {{{ !$q['no_found_rows'] }}} should prevent the extra
SELECT FOUND_ROWS() from running, correct?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14426#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list