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

WordPress Trac noreply at wordpress.org
Thu Apr 11 01:13:30 UTC 2024


#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 enghell):

 Replying to [comment:59 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.

 My two cents on this, it may be wise to deprecate `posts_request` filter
 and push `posts_pre_query` as replacement.

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


More information about the wp-trac mailing list