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

DB performance issue with get_config

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_26_STABLE

      Description

      We are seeing slowness on our servers from this query:

      SELECT value FROM mdl_config WHERE name = 'siteidentifier'
      

      We tracked the query down to get_config method which is being called from initialise_cfg.

      So, it appears that on every page page load, this query is being executed. Also, the reason for the query seems a little odd, like for detecting if we are doing an install or similar. I looked at the original code that added this in and it used to disable caches when the query failed, but that line was removed.

      Anyways, seeking advice on refactoring so this query isn't executed on every page.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bushido Mark Nielsen
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: