[wp-trac] [WordPress Trac] #47280: SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17

WordPress Trac noreply at wordpress.org
Fri Sep 8 16:07:49 UTC 2023


#47280: SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17
-------------------------------------------------+-------------------------
 Reporter:  javorszky                            |       Owner:
                                                 |  johnbillion
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Database                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests early       |     Focuses:
  changes-requested                              |  performance
-------------------------------------------------+-------------------------

Comment (by johnbillion):

 Quick status update on this:

 1. The `posts_request` filter is a real stumbling block for this change.
 The SQL to perform the count query can be reliably adjusted to work
 without `SQL_COUNT_FOUND_ROWS`, but the `posts_request` filter runs
 between the query being constructed and before it runs, which means
 arbitrary changes to the query can be made in a filter and cause the count
 query to be incorrect. We'll need some suggestions for how to solve this.
 2. There are some valid concerns about the performance of the count query,
 even though it's the query structure that MySQL recommends. This needs
 some benchmarking.
 3. A few other todos in the description of the PR.

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


More information about the wp-trac mailing list