Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37370

fts_phrase_or_proximity_search() is quadratic instead of linear

    XMLWordPrintable

Details

    • Related to performance
    • Q4/2026 Server Development

    Description

      MySQL 8.0.43 includes the change Bug #37682648 InnoDB FTS slow in phrase search due to inefficient matching of doc_id. If we ignore all the boilerplate changes and renaming of two functions, it boils down to revising fts_phrase_or_proximity_search() in such a way that we remember where a previous search left off, so that we will avoid restarting the search from the beginning.

      We might want to take this further and introduce a template parameter for the query mode, so that each template expansion handles only FTS_PHRASE or FTS_PROXIMITY but not both. I wouldn’t introduce any Vector_wrapper but instead consider extending or replacing the ib_vector_t if needed.

      Attachments

        1. with.txt
          1.0 kB
        2. without.txt
          1 kB
        3. bench.sh
          2 kB

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            marko Marko Mäkelä
            Thirunarayanan Balathandayuthapani Thirunarayanan Balathandayuthapani
            Thirunarayanan Balathandayuthapani Thirunarayanan Balathandayuthapani
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 0.5d
                0.5d
                Logged:
                Time Spent - Not Specified
                Not Specified

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.