[wp-trac] Re: [WordPress Trac] #7415: "using filesort" in default install

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 15 09:31:23 GMT 2009


#7415: "using filesort" in default install
--------------------------+-------------------------------------------------
 Reporter:  dbuser123     |       Owner:  anonymous                                     
     Type:  defect (bug)  |      Status:  new                                           
 Priority:  high          |   Milestone:  2.8                                           
Component:  Optimization  |     Version:  2.7                                           
 Severity:  major         |    Keywords:  database, optimization, slow queries, filesort
--------------------------+-------------------------------------------------

Comment(by mrmist):

 Replying to [comment:32 rawalex]:
 > Because of the overhead of calc_found_rows, wouldn't it just be better
 to make the first query full without limits and count it, and control the
 number of items displayed elsewhere?  Right now you are doing two full
 queries, which would be more intensive, no?

 The mysql docs say


 {{{
 If you are using SELECT SQL_CALC_FOUND_ROWS, MySQL must calculate how many
 rows are in the full result set. However, this is faster than running the
 query again without LIMIT, because the result set need not be sent to the
 client.
 }}}


 And I'm tempted to agree. If you have a massive results set the last thing
 you would want to do is return the entire thing to the client.

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


More information about the wp-trac mailing list