Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-24598

Performance issue retrieving attachments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.7.2, 2.8.0, 2.8.1, 2.9.0
    • Fix Version/s: 2.7.2, 2.8.2, 2.9.0
    • Component/s: Messages Tool
    • Labels:
      None
    • 2.9 Status:
      Resolved
    • Previous Issue Keys:
      MSGCNTR-654

      Description

      From the dev list reported by Ashley Willis:
      Feb 02 2012

      We are running Sakai 2.7.0 msgcntr 2.7.5. We have noticed certain forums
      take several minutes to load in 2.7.5. The forum is not terribly large,
      roughly 6 forums with 13 topics per forum. The instructor creates a
      forum for each assignment and a topic for each student under each forum.
      Students typically just upload an attachment as a response to their
      topic as the assignment. What we have found is that this query is
      getting called thousands of times in a loop with different surrogateKeys
      which explains the long load times:

      select attachment0_.ID as ID65_, attachment0_.VERSION as VERSION65_,
      attachment0_.UUID as UUID65_,
      attachment0_.CREATED as CREATED65_, attachment0_.CREATED_BY as
      CREATED5_65_, attachment0_.MODIFIED
      as MODIFIED65_, attachment0_.MODIFIED_BY as MODIFIED7_65_,
      attachment0_.ATTACHMENT_ID as ATTACHMENT8_65_,
      attachment0_.ATTACHMENT_URL as ATTACHMENT9_65_,
      attachment0_.ATTACHMENT_NAME as ATTACHMENT10_65_,
      attachment0_.ATTACHMENT_SIZE as ATTACHMENT11_65_,
      attachment0_.ATTACHMENT_TYPE as ATTACHMENT12_65_,
      attachment0_.m_surrogateKey as m13_65_, attachment0_.of_surrogateKey as
      of14_65_, attachment0_.pf_surrogateKey
      as pf15_65_, attachment0_.t_surrogateKey as t16_65_ from
      MFR_ATTACHMENT_T attachment0_ where
      attachment0_.t_surrogateKey=403560

      On a whim, we rolled back to msgcntr to 2.7.0 and this doesn't happen,
      the forum loads in a reasonable time. We don't see this query being
      executed over and over.

      ------------------------------------------------------------------------------------------
      Update,
      So we have traced it to this change between 2.7.0 and 2.7.5:

      DiscussionTopicBean.getAttachList()

      In 2.7.5 the attachment list is built by calling forumManager which makes a db call to get attachments for each topic id.

      List<Attachment> attachList = forumManager.getTopicAttachments(topic.getId());

      We rolled this back to the 2.7.0 method of just getting the list from topic and the problem went away.
      List<Attachment> attachList = topic.getAttachments();

      Still investigating but this seems to be the issue for us.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  baholladay Bryan Holladay
                  Reporter:
                  arwhyte Anthony Whyte
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration