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

Serious performance issue with activity names filter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.7
    • 2.7
    • Performance
    • MOODLE_27_STABLE
    • MOODLE_27_STABLE
    • wip-MDL-45038-master
    • Hide
      1. Enable conditional availability
      2. Enable activity names filter
      3. Make sure student is enrolled in several courses with modules in them and courses have descriptions
      4. View frontpage with the list of courses and /my/ page, make sure the db read queries do not go crazy
      Show
      Enable conditional availability Enable activity names filter Make sure student is enrolled in several courses with modules in them and courses have descriptions View frontpage with the list of courses and /my/ page, make sure the db read queries do not go crazy

      On my site with 11 courses and 1K course modules, i'm getting 500 queries on the front page when logged in as admin.

      Some things I have enabled:

      • Display courses on the front page when logged in
      • Activity names filter

      A very hacky investigation in the postgres log indicates a problem checking the course record many many times:

      12  SELECT active.filter, fc.name, fc.value
        12  SELECT ctx.*
        30  SELECT f.id AS id, f.contenthash, f.pathnamehash, f.contextid, f.component, f.filearea, f.itemid, f.filepath, f.filename, f.userid, f.filesize, f.mimetype, f.status, f.source, f.author, f.license, f.timecreated, f.timemodified, f.sortorder, f.referencefileid, r.repositoryid AS repositoryid, r.reference AS reference, r.lastsync AS referencelastsync
        33  SELECT * FROM mdl_context WHERE contextlevel = $1 AND instanceid = $2
        33  SELECT * FROM mdl_enrol WHERE courseid = $1 AND status = $2  ORDER BY sortorder,id
      1332  SELECT * FROM mdl_course WHERE id = $1
      

      im=# select count(*) from mdl_course;
       count
      -------
          11
      (1 row)
       
      im=# select count(*) from mdl_course_modules;
       count
      -------
        1040
      (1 row)
      

            marina Marina Glancy
            poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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