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

Include unsubscribes in the forum subscription cache to improve performance

    XMLWordPrintable

    Details

      Description

      When looking to some DB performance problems @ MDL-65069, it was detected that this query:

      SELECT id, discussion, preference FROM mdl_forum_discussion_subs WHERE userid = $1 AND forum = $2 array (
        0 => '2',
        1 => 107,
      )
      

      Is executed 65 times in a forum/view page plenty of discussions.

      Tracing down the problem... it seems that mod_foum\subscriptions::fill_discussion_subscription_cache() does not cache query misses... and that causes the same query to be executed as many times as discussions are in a page.

      This should be fixed in all supported branches because they are lots of queries for nothing.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              peterdias Peter Dias
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Peer reviewer:
              Neill Magill
              Integrator:
              Andrew Nicols
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 40 minutes
                  5h 40m