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

Server files extremely slow on sites with lots of activities and files

    XMLWordPrintable

Details

    Description

      When trying to use 'Server files' in the file picker repository list at a site context it can take an extremely long time to complete on a site with a large number of activities and files.

      The server files loaded for us at the site level in Moodle 3.2 at a reasonable speed

      For example on our site it takes over an hour for the request to complete when trying to look at the site level folder.

      It appears that the query in file_info_context_course::get_module_areas_with_files() is the cause.

      The explaine for the query is:

      id select_type table type possible_keys key key_len ref rows Extra
      1 SIMPLE ctx ref PRIMARY,mdl_cont_conins_uix,mdl_cont_pat_ix mdl_cont_conins_uix 8 const 1611769 Using where; Using temporary; Using filesort
      1 SIMPLE f ref mdl_file_con2_ix mdl_file_con2_ix 8 moodlerc_17May2018.ctx.id 3 Using where
      • Individually the query takes around 4 seconds to run
      • at the site level it is run nearly 400 times

      Attachments

        1. performance-summary.png
          61 kB
          Neill Magill
        2. performance-trace.png
          79 kB
          Neill Magill

        Issue Links

          Activity

            People

              nmagill Neill Magill
              nmagill Neill Magill
              Shamim Rezaie Shamim Rezaie
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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