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

Poor performance due to excessive queries

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.10
    • Component/s: Forum
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Oct/10