Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-35026 Investigate code efficiency in delivery
  3. SAK-35129

Batch retrieve information from secondary tables like metadata, feedback, etc

    XMLWordPrintable

    Details

      Description

      Hibernate creates excessive queries when a student takes an assessment. Using a batch-size=50 on some of the joined tables drastically reduces the number of queries generated by Hibernate.

      Here is a before and after:

      1. Profile
      2. Rank Query ID Response time Calls R/Call V/M Item
      3. ==== ================== ============= ===== ====== ===== ===============
      4. 1 0xF72B58FB7872444F 0.0000 0.0% 2592 0.0000 0.00 SELECT SAM_PUBLISHEDANSWERFEEDBACK_T
      5. 2 0x30AAEC10BC3D0C37 0.0000 0.0% 1967 0.0000 0.00 SELECT
      6. 3 0x7B321C64B690F933 0.0000 0.0% 1967 0.0000 0.00 SELECT DUAL
      7. 4 0x8528474A11E9158E 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDANSWER_T SAM_PUBLISHEDITEM_T SAM_PUBLISHEDSECTION_T
      8. 5 0x4B09B4047AB2D7FD 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDITEMMETADATA_T
      9. 6 0x6BE7D4547ED866E8 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDATTACHMENT_T
      10. 7 0x33833ECBF517E699 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDITEMFEEDBACK_T
      11. 8 0x81B8D088BC9275F7 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDITEMTEXT_T
      12. 9 0x813031B8BBC3B329 0.0000 0.0% 267 0.0000 0.00 COMMIT
      13. 10 0xD6017D7AB4112E73 0.0000 0.0% 214 0.0000 0.00 SELECT SAKAI_REALM_ROLE SAKAI_REALM
      14. 11 0x71EDBCAFE9C19399 0.0000 0.0% 178 0.0000 0.00 SELECT SAKAI_SITE
      15. 12 0x0178F4CBD8937E9E 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_TOOL
      16. 13 0xB301E84D5633A6F4 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_PAGE
      17. 14 0x3E59A7992AE92745 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_TOOL_PROPERTY
      18. 15 0x5E9A5113A94F230B 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_GROUP
      19. 16 0x0314AAE8FA5EE5BA 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_PAGE_PROPERTY
      20. 17 0xA446D2EAF712755B 0.0000 0.0% 177 0.0000 0.00 SELECT SAKAI_SITE_GROUP_PROPERTY
      21. 18 0x0335037ADB752588 0.0000 0.0% 117 0.0000 0.00 SELECT SAM_ITEMGRADING_T
      22. 19 0x84DB24339A5AA106 0.0000 0.0% 59 0.0000 0.00 SELECT SAKAI_REALM_RL_FN SAKAI_REALM SAKAI_REALM_FUNCTION SAKAI_REALM_RL_GR SAKAI_REALM
      23. 20 0x4CD27207CF6FEB01 0.0000 0.0% 56 0.0000 0.00 SELECT SAKAI_EVENT SAKAI_SESSION
      24. MISC 0xMISC 0.0000 0.0% 534 0.0000 0.0 <113 ITEMS>
      1. Profile
      2. Rank Query ID Response time Calls R/Call V/M Item
      3. ==== ================== ============= ===== ====== ===== ===============
      4. 1 0x7B321C64B690F933 0.0000 0.0% 701 0.0000 0.00 SELECT DUAL
      5. 2 0x30AAEC10BC3D0C37 0.0000 0.0% 701 0.0000 0.00 SELECT
      6. 3 0x4B09B4047AB2D7FD 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDITEMMETADATA_T
      7. 4 0x33833ECBF517E699 0.0000 0.0% 672 0.0000 0.00 SELECT SAM_PUBLISHEDITEMFEEDBACK_T
      8. 5 0x813031B8BBC3B329 0.0000 0.0% 225 0.0000 0.00 COMMIT
      9. 6 0x0335037ADB752588 0.0000 0.0% 117 0.0000 0.00 SELECT SAM_ITEMGRADING_T
      10. 7 0xD6017D7AB4112E73 0.0000 0.0% 51 0.0000 0.00 SELECT SAKAI_REALM_ROLE SAKAI_REALM
      11. 8 0x2EEE3AB6C878CC88 0.0000 0.0% 51 0.0000 0.00 SELECT SAM_ASSESSMENTGRADING_T
      12. 9 0x966DDF6670E1B4D9 0.0000 0.0% 48 0.0000 0.00 SELECT SAM_PUBLISHEDANSWER_T SAM_PUBLISHEDITEM_T SAM_PUBLISHEDSECTION_T
      13. 10 0xA8A8B4ED3DCBDCF0 0.0000 0.0% 48 0.0000 0.00 SELECT SAM_PUBLISHEDITEMTEXT_T
      14. 11 0xF12AC66D5BF4FB94 0.0000 0.0% 48 0.0000 0.00 SELECT SAM_PUBLISHEDANSWERFEEDBACK_T
      15. 12 0xB301E84D5633A6F4 0.0000 0.0% 48 0.0000 0.00 SELECT SAKAI_SITE_PAGE
      16. 13 0x4CD27207CF6FEB01 0.0000 0.0% 48 0.0000 0.00 SELECT SAKAI_EVENT SAKAI_SESSION
      17. 14 0x1D9B9FC5A663D1C0 0.0000 0.0% 48 0.0000 0.00 SELECT SAM_PUBLISHEDATTACHMENT_T
      18. 15 0x5E9A5113A94F230B 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE_GROUP
      19. 16 0x0314AAE8FA5EE5BA 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE_PAGE_PROPERTY
      20. 17 0x0178F4CBD8937E9E 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE_TOOL
      21. 18 0x3E59A7992AE92745 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE_TOOL_PROPERTY
      22. 19 0xA446D2EAF712755B 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE_GROUP_PROPERTY
      23. 20 0x71EDBCAFE9C19399 0.0000 0.0% 47 0.0000 0.00 SELECT SAKAI_SITE
      24. MISC 0xMISC 0.0000 0.0% 260 0.0000 0.0 <54 ITEMS>

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ottenhoff Sam Ottenhoff
                  Reporter:
                  ottenhoff Sam Ottenhoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code