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

Task logs page with filled "is equal to" filter is taking long to load

    XMLWordPrintable

Details

    • MOODLE_400_STABLE, MOODLE_401_STABLE

    Description

      A Moodle instance has lots of data in the mdl_task_log table. The Task logs admin page with "is equal to" filter set to some value (task name) may take minutes to load.

      This seems to be happening because of added LOWER() function to $DB->sql_equal() https://github.com/moodle/moodle/blob/5e1df255667070445122c7822d21e66b2e0435fa/lib/dml/moodle_database.php#L2262 for the IS_EQUAL_TO type of the text filter https://github.com/moodle/moodle/blob/5e1df255667070445122c7822d21e66b2e0435fa/reportbuilder/classes/local/filters/text.php#L140-L143

      It's known that LOWER() prevents DBs from hitting indexis so this why a simple query like SELECT * FROM mdl_task_log WHERE LOWER(classname) = LOWER('core\task\task_log_cleanup_task') may take ages to complete.

      As a potential solution it would probably work to implement case-insensitive search and resolve MDL-64688.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mikhailgolenkov Misha Golenkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: