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

Performance problem from a query in in mdl_comments

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.5
    • 4.0.4
    • Questions

      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 

            timhunt Tim Hunt
            thomas.ludwig Thomas Ludwig
            Thomas Ludwig Thomas Ludwig
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.