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

Index needed on event table (uuid, subscriptionid)

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.3, 3.3
    • 3.5
    • Calendar
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_35_STABLE
    • MDL-59438-master
    • 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.

    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

              rezaie9 Shamim Rezaie
              maherne Michael Aherne
              Simey Lameze Simey Lameze
              Damyon Wiese Damyon Wiese
              Mark Nelson Mark Nelson
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18