Moodle
  1. Moodle
  2. MDL-28500

Changing the indexes on log table

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: BACKEND
    • Component/s: Logging
    • Labels:
    • Rank:
      18158

      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.

        Activity

        Hide
        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
        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.

          People

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

            Dates

            • Created:
              Updated: