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

Optimise report_outline

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.9.23, 4.1.5
    • Performance, Reports
    • MOODLE_39_STABLE, MOODLE_401_STABLE

      This can take a long time to run for large datasets.

      Be good to optimise SQL if possible or filter results to last 3 months on first load.

      Facing this issue with large logstore_standard_log - approx 28,000,000 million rows. (indexed ~11,000,000 rows) Takes approx 8 minutes to load on a production server.

      "SELECT contextinstanceid as cmid, 
          COUNT('x') AS numviews, 
          COUNT(DISTINCT userid) AS distinctusers , 
          MAX(timecreated) AS lasttime
      FROM {logstore_standard_log} l
      WHERE courseid = :courseid
      AND anonymous = 0
      AND crud = 'r'
      AND contextlevel = :contextmodule
      GROUP BY contextinstanceid"
      

      Initial load of the page uses all results and don't get option to filter by date until after page load.

      Filtering the results to say the last 3 months on first page load will reduce load time, making it quicker for the user to then  decide what they would like to filter if at all.

       

            Unassigned Unassigned
            x-iy David Adamson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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