[wp-trac] [WordPress Trac] #29178: Using WP_Query only for result of SQL_CALC_FOUND_ROWS

WordPress Trac noreply at wordpress.org
Fri Feb 13 03:31:25 UTC 2015


#29178: Using WP_Query only for result of SQL_CALC_FOUND_ROWS
-----------------------------+-----------------------------
 Reporter:  danielbachhuber  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Query            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+-----------------------------
Changes (by danielbachhuber):

 * keywords:  reporter-feedback close => needs-patch


Comment:

 Feeling a bit deja vu on this conversation. I think Boone and I chatted on
 Skype about this, and never summarized here.

 For the purposes of solely getting a total count, `SELECT COUNT(*)` is
 fastest, and is one query. `SELECT COUNT(*)` is also faster when used as a
 replacement for `SQL_CALC_FOUND_ROWS`:
 http://www.percona.com/blog/2007/08/28/to-sql_calc_found_rows-or-not-to-
 sql_calc_found_rows/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29178#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list