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

external_tokens table will benefit from index on token field

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Upgrading

      1. Install a version of Moodle without this patch (i.e. the most recent weekly development build)
      2. Update the code to include this version
      3. Run the Moodle upgrade
      4. Verify there are no PHP errors at any stage
      5. Access the Moodle database directly
      6. Verify that there is an index for the token field in the external_tokens table

      Installing

      1. Install Moodle using a version that includes this patch
      2. Access the Moodle database directly
      3. Verify that there is an index for the token field in the external_tokens table
      Show
      Upgrading Install a version of Moodle without this patch (i.e. the most recent weekly development build) Update the code to include this version Run the Moodle upgrade Verify there are no PHP errors at any stage Access the Moodle database directly Verify that there is an index for the token field in the external_tokens table Installing Install Moodle using a version that includes this patch Access the Moodle database directly Verify that there is an index for the token field in the external_tokens table
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When tokens are looked up during a web service call the query used to check them performs a full table scan on the external_tokens table.

      Adding an index to the token field would avoid this.

      While it does not appear to be adding a large overhead right now, I can imagine that as the popularity of the Mobile app increases it could eventually start to become an issue for large sites.

      It would benefit queries in:

        Attachments

          Activity

            People

            Assignee:
            nmagill Neill Magill
            Reporter:
            nmagill Neill Magill
            Peer reviewer:
            Juan Leyva
            Integrator:
            Andrew Nicols
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Nov/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 40 minutes
                1d 40m