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

Include unsubscribes in the forum subscription cache to improve performance

XMLWordPrintable

      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.

            peterdias Peter Dias
            stronk7 Eloy Lafuente (stronk7)
            Neill Magill Neill Magill
            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 - 5 hours, 40 minutes
                5h 40m

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