Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16902

Improve search results count for MySQL

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 4.0.0-a1, 3.3.5
    • 3.3.6-RC1
    • Search
    • None

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: