Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-16902

Improve search results count for MySQL

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.6-RC1
    • 4.0.0-a1, 3.3.5
    • Search
    • None

      Currently for MySQL search backend SQL_CALC_FOUND_ROWS with FOUND_ROWS() is used to count total search results.

      As per https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_found-rows The SQL_CALC_FOUND_ROWS query modifier and accompanying FOUND_ROWS() function are deprecated as of MySQL 8.0.17 and are expected to be removed later.

      MySQL documentation advices using COUNT() instead, also it's subject to certain optimizations unlike SQL_CALC_FOUND_ROWS.

      Also, on some DBMS versions when phpBB's debug.sql_explain is enabled queries like EXPLAIN SELECT FOUND_ROWS() as result_count return 0 despite there're results in a search (which is a bug).

            Marc Marc
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: