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

Poor performance due to excessive queries

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.10
    • 1.9.8
    • Forum
    • None
    • MySQL
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      On Moodle 1.9.8, when viewing a faculty profile (while logged in as Admin), if I view the faculty member's forum posts, the page takes quite awhile to load.
      Once it has loaded, these are the performance stats in the footer:
      12.830042 secs
      RAM: 17.1MB
      RAM peak: 29.5MB
      Included 111 files
      DB queries 13051
      Log writes 1
      Load average: 0.40

      Note that DB queries shows 13,051... It took this page 13s to generate (considering the # of queries, that's actually impressive), and uses 30mb of ram, all to display 5 forum posts, with a max of 2 pages in pagination.

      This is quite shocking. The raw number of queries here, is something that I haven't seen since the days of PHP-Nuke popularity (which was very poor code indeed).

      Why would thousands of queries be needed to simply pull up what posts a person has made?
      I can understand additional queries being needed if there are a large number of courses (we have ~100 courses in our installation), but this suggests very poor design.

        1. 2010101500-MDL-24638.patch
          2 kB
          Aparup Banerjee

            nebgor Aparup Banerjee
            jlangevin Jonathan Langevin (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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