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

Serious performance issue with activity names filter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Performance
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      wip-MDL-45038-master

      Description

      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)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marina Marina Glancy
              Reporter:
              poltawski Dan Poltawski
              Integrator:
              Dan Poltawski
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14