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

Possible index missing (target and action) on logstore_standard_log - Unoptimized SQL query resulting in System Status page not loading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.4.4
    • Antivirus
    • None
    • MOODLE_404_STABLE

      When accessing the System Status report page on Moodle the SQL query that interrogates the standard log store table for the purposes of finding antivirus detections  can take longer than 30 minutes to return data where there is a large data set in the logstore table

      As a result the System Status page becomes frustratingly unusable 

      In very large mdl_logstore_standard_log tables, the SQL Query Optimizer does not use the indexes (likely due to the inner calculations that the optimizer performs), and instead performs a full table scan. This can take in excess of 30 minutes, depending on the number of rows. However, using the 'FORCE INDEX' statement (mdl_logsstanlog_tim_ix) on the query can return the same query in less than 20 seconds.

       Can the query be rewritten to include the 'FORCE INDEX' directive in the SQL query?

            Unassigned Unassigned
            jimharris Jim Harris
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 minutes
                2m

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