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

Improve performance of get_tags_by_area_in_contexts SQL query

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5
    • 3.5
    • Tags

      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);
      

            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

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.