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

Index needed on event table (uuid, subscriptionid)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.3, 3.3
    • Fix Version/s: 3.5
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      1. Connect to the DB server using your preferred SQL client and run the following query on your Moodle DB (use your own DB prefix instead of mdl_):

        SHOW INDEX FROM mdl_event;
        

      2. Confirm that you see an index for the subscriptionid field and also an index for the uuid field.
      Show
      Connect to the DB server using your preferred SQL client and run the following query on your Moodle DB (use your own DB prefix instead of mdl_): SHOW INDEX FROM mdl_event; Confirm that you see an index for the subscriptionid field and also an index for the uuid field.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59438-master

      Description

      We're seeing a slow query in our MySQL monitoring which is due to it having to do a full table scan rather than using an index. It's in calendar_add_icalendar_event():

      $DB->get_record('event', array('uuid' => $eventrecord->uuid,
              'subscriptionid' => $eventrecord->subscriptionid)
      

      It would be useful if there was an index this query could use.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rezaie9 Shamim Rezaie
              Reporter:
              maherne Michael Aherne
              Peer reviewer:
              Simey Lameze
              Integrator:
              Damyon Wiese
              Tester:
              Mark Nelson
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18