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

Changing the indexes on log table

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1
    • Fix Version/s: BACKEND
    • Component/s: Logging
    • Labels:

      Description

      Currently the indexes in the log table are not very good.

      • First of all, there are none (or almost none) queries to the log table that don't limit the result by time. So, time should be in any index. In maybe worth indexing not the full value of time but just first 6-7 digits which would result in hours-or-days chunks. In this case the size of index will decrease significantly but the performance will remain.
      • Index on only one field action is useless
      • when generating reports action is often queried as %view%, %add%, etc., which makes the action field in index useless as well. In order to use the indexed action pattern should look like view%, add% (at the moment probably not possible)

      Probably there are more issues. Existing queries in the code should be analyzed.

      There also should be strict guidelines how to form the value of action. In order to properly use the indexed action the verb (view, add, update, ...) should be the first word. At the moment there are also actions like 'templates view', 'field add', and so on.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            dougiamas Martin Dougiamas added a comment -

            I agree that logging needs to be revisited as part of a rewrite for:

            • activity streams per-user, and
            • live data analytics, and
            • log rotating / archiving

            But it's a huge project. Probably 2.3.

            Show
            dougiamas Martin Dougiamas added a comment - I agree that logging needs to be revisited as part of a rewrite for: activity streams per-user, and live data analytics, and log rotating / archiving But it's a huge project. Probably 2.3.
            Hide
            marina Marina Glancy added a comment -

            Closing this issue since the Logging API has been introduced in 2.7

            Since 2.7 the logging is performed by "logstore" plugins (admin/tool/log/store/) and they contol their DB tables and their indexes themselves. For example logstore_standard has indexes convenient for standard Moodle reports

            Show
            marina Marina Glancy added a comment - Closing this issue since the Logging API has been introduced in 2.7 Since 2.7 the logging is performed by "logstore" plugins (admin/tool/log/store/) and they contol their DB tables and their indexes themselves. For example logstore_standard has indexes convenient for standard Moodle reports

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: