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

Small patch to greatly reduce the number of database queries on the front page for administrators

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3
    • Component/s: Libraries
    • Labels:

      Description

      While working on a navigation issue I noticed that the function moodle_needs_upgrading() was making hundreds of calls to get_config for plugins, which in turn was leading to hundreds of database queries.
      I had a quick look at the code and think there is a pretty easy solution to reduce that hundreds of queries to a single query.
      I've created a branch and will put this up for peer-review now.

      Please note it only effects those with the moodle/site:config and only where moodle_needs_upgrading(). Pretty much site front page and admin/index.php are the main two.

      Cheers
      Sam

        Gliffy Diagrams

          Activity

          Hide
          samhemelryk Sam Hemelryk added a comment -

          Up for peer-review

          Show
          samhemelryk Sam Hemelryk added a comment - Up for peer-review
          Hide
          poltawski Dan Poltawski added a comment -

          Looks good - get_config a great target for MUC eh?

          Show
          poltawski Dan Poltawski added a comment - Looks good - get_config a great target for MUC eh?
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks Dan, submitting for integration now.
          get_config when provided with a plugin name probably would be a great area to look at for shared caching.

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks Dan, submitting for integration now. get_config when provided with a plugin name probably would be a great area to look at for shared caching. Cheers Sam
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Passed all the steps. So passing this, thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Passed all the steps. So passing this, thanks!
          Hide
          nebgor Aparup Banerjee added a comment -

          The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

          Closing, have a good weekend!

          Show
          nebgor Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Jun/12