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

Improve performance of get_tags_by_area_in_contexts SQL query

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Tags
    • Labels:

      Description

      Tim noticed while reviewing MDL-61135 that the query for get_tags_by_area_in_contexts will not be very performant.

      It can easily be re-written to perform better.

      Andrew suggested something along the lines of:

      select distinct t.* from mdl_tag t inner join mdl_tag_instance ti on t.id = ti.tagid where component = 'abc' and itemtype = 'def' and contextid in (1,2,3,4,5);
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lameze Simey Lameze
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Mark Nelson
              Integrator:
              Andrew Nicols
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

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

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h