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

Improve performance of get_tags_by_area_in_contexts SQL query

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5
    • 3.5
    • Tags

    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

              lameze Simey Lameze
              ryanwyllie Ryan Wyllie
              Mark Nelson Mark Nelson
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                17/May/18

                Time Tracking

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