Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75752

Performance problem from a query in in mdl_comments

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.4
    • 4.0.5
    • Questions

    Description

      After updating to Moodle 4.0, we noticed slow queries on mdl_comments in the database.

      These always have the same query as cause:

      SELECT c.*
      FROM mdl_comments c
      WHERE c.commentarea = 'question'
             AND c.component = 'qbank_comment' 
              AND c.itemid = '1234' 

      The query came with MDL-71642 for backup of questions in core.

      We have now observed the query in production for a few days and see a payload of 25% to about 60% on the database.

      The cause for this behavior could be a missing index on

      commentarea, component, itemid 

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              thomas.ludwig Thomas Ludwig
              Thomas Ludwig Thomas Ludwig
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Nov/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 11 minutes
                  3h 11m