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

Replace MAX SQL in functions_posting.php

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.2.5
    • 3.2.6-RC1
    • ACP, Posting
    • PHP all, MySQL all

    Description

      In large phpBB installs, the query beginning on line 205 of includes/functions_posting.php

      Takes a very, very long time - upwards of 10 min. I'm testing this on a site with ~24 million posts. Adding a compound key of (forum_id,topic_id,post_visibility) to the posts table get the query down to about 3 seconds. But replacing MAX with ORDER BY p.post_id, LIMIT 1, reduces query time to around 0.5ms on my server.

      This probably isn't an issue for small communities, but with larger databases, it causes the delete post function to always time out.

      I will add PR in github.

      Attachments

        Activity

          People

            Marc Marc
            soviet9k soviet9k [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: