explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9DiC

Settings
# exclusive inclusive rows x rows loops node
1. 5.954 4,356.241 ↓ 497.0 2,982 1

HashAggregate (cost=1,365.80..1,365.86 rows=6 width=1,972) (actual time=4,355.462..4,356.241 rows=2,982 loops=1)

  • Group Key: asde.course_module_id, asde.assessment_type, asde.student_idnumber, asde.moodle_course_id, code.unisa_course_id, code.term_code, code.catalogue_number, code.subject_area_code, code.offer_type_code, asde.individual_ext, asde.global_ext, asde.assessment_weighting, asde.grade_letter, asde.course_outline_id, asgn.name, asgn.allowsubmissionsfromdate, asgn.cutoffdate, asgn.duedate, (CASE WHEN ((asub.status)::text <> 'submitted'::text) THEN 'no submission'::character varying ELSE asub.status END), fils.filename, ptfs.externalid, ptfs.similarityscore
2.          

CTE course_details

3. 0.602 6.023 ↑ 4.1 1,109 1

Hash Join (cost=402.18..548.45 rows=4,583 width=188) (actual time=4.750..6.023 rows=1,109 loops=1)

  • Hash Cond: (grmb.groupid = grgr.groupid)
4. 1.169 5.178 ↑ 1.0 2,414 1

Hash Join (cost=376.44..458.77 rows=2,414 width=22) (actual time=3.698..5.178 rows=2,414 loops=1)

  • Hash Cond: (grmb.userid = musr.id)
5. 0.360 0.360 ↑ 1.0 2,414 1

Seq Scan on mdl_groups_members grmb (cost=0.00..49.14 rows=2,414 width=16) (actual time=0.005..0.360 rows=2,414 loops=1)

6. 1.617 3.649 ↑ 1.0 5,926 1

Hash (cost=301.75..301.75 rows=5,975 width=14) (actual time=3.649..3.649 rows=5,926 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 342kB
7. 2.032 2.032 ↑ 1.0 5,926 1

Seq Scan on mdl_user musr (cost=0.00..301.75 rows=5,975 width=14) (actual time=0.003..2.032 rows=5,926 loops=1)

8. 0.014 0.243 ↑ 8.6 41 1

Hash (cost=21.35..21.35 rows=352 width=182) (actual time=0.243..0.243 rows=41 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
9. 0.105 0.229 ↑ 8.6 41 1

Hash Join (cost=4.75..21.35 rows=352 width=182) (actual time=0.081..0.229 rows=41 loops=1)

  • Hash Cond: (grgr.groupingid = ucof.grouping_id)
10. 0.065 0.065 ↑ 1.0 568 1

Seq Scan on mdl_groupings_groups grgr (cost=0.00..10.87 rows=587 width=16) (actual time=0.007..0.065 rows=568 loops=1)

11. 0.004 0.059 ↑ 1.5 4 1

Hash (cost=4.68..4.68 rows=6 width=182) (actual time=0.059..0.059 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.015 0.055 ↑ 1.5 4 1

Hash Join (cost=2.43..4.68 rows=6 width=182) (actual time=0.050..0.055 rows=4 loops=1)

  • Hash Cond: (ucrs.id = ucof.unisa_course_id)
13. 0.009 0.032 ↑ 2.0 3 1

Hash Join (cost=1.20..3.37 rows=6 width=148) (actual time=0.029..0.032 rows=3 loops=1)

  • Hash Cond: (mcrs.id = ucrs.moodle_course_id)
14. 0.013 0.013 ↑ 1.0 6 1

Seq Scan on mdl_course mcrs (cost=0.00..2.09 rows=6 width=8) (actual time=0.008..0.013 rows=6 loops=1)

  • Filter: (visible = 1)
  • Rows Removed by Filter: 1
15. 0.002 0.010 ↑ 3.0 3 1

Hash (cost=1.09..1.09 rows=9 width=148) (actual time=0.010..0.010 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.008 0.008 ↑ 3.0 3 1

Seq Scan on mdl_unisa_course ucrs (cost=0.00..1.09 rows=9 width=148) (actual time=0.007..0.008 rows=3 loops=1)

17. 0.005 0.008 ↑ 2.5 4 1

Hash (cost=1.10..1.10 rows=10 width=50) (actual time=0.008..0.008 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.003 0.003 ↑ 2.5 4 1

Seq Scan on mdl_unisa_course_offering ucof (cost=0.00..1.10 rows=10 width=50) (actual time=0.003..0.003 rows=4 loops=1)

19.          

CTE assessment_details

20. 9.802 68.130 ↓ 2,981.0 2,981 1

Nested Loop (cost=1.25..65.35 rows=1 width=668) (actual time=0.255..68.130 rows=2,981 loops=1)

21. 0.481 1.689 ↓ 2,981.0 2,981 1

Nested Loop (cost=0.97..24.13 rows=1 width=116) (actual time=0.145..1.689 rows=2,981 loops=1)

22. 0.013 0.194 ↓ 39.0 39 1

Nested Loop (cost=0.69..23.13 rows=1 width=116) (actual time=0.059..0.194 rows=39 loops=1)

23. 0.013 0.145 ↓ 6.0 6 1

Nested Loop Semi Join (cost=0.41..18.74 rows=1 width=116) (actual time=0.051..0.145 rows=6 loops=1)

  • Join Filter: ((mods.name)::text = "*VALUES*".column1)
  • Rows Removed by Join Filter: 6
24. 0.005 0.120 ↓ 6.0 6 1

Nested Loop (cost=0.41..18.54 rows=1 width=116) (actual time=0.041..0.120 rows=6 loops=1)

25. 0.013 0.079 ↓ 6.0 6 1

Nested Loop (cost=0.27..17.62 rows=1 width=66) (actual time=0.035..0.079 rows=6 loops=1)

26. 0.012 0.012 ↓ 3.0 6 1

Seq Scan on mdl_unisa_assessment uass (cost=0.00..1.02 rows=2 width=34) (actual time=0.009..0.012 rows=6 loops=1)

27. 0.054 0.054 ↑ 1.0 1 6

Index Scan using mdl_courmodu_id_pk on mdl_course_modules cmod (cost=0.27..8.29 rows=1 width=40) (actual time=0.008..0.009 rows=1 loops=6)

  • Index Cond: (id = uass.cm_id)
  • Filter: ((assessment_genre = 1) AND (visible = 1))
28. 0.036 0.036 ↑ 1.0 1 6

Index Scan using mdl_modu_id_pk on mdl_modules mods (cost=0.14..0.91 rows=1 width=66) (actual time=0.005..0.006 rows=1 loops=6)

  • Index Cond: (id = cmod.module)
29. 0.007 0.012 ↑ 3.0 2 6

Materialize (cost=0.00..0.11 rows=6 width=32) (actual time=0.001..0.002 rows=2 loops=6)

30. 0.005 0.005 ↑ 1.2 5 1

Values Scan on "*VALUES*" (cost=0.00..0.08 rows=6 width=32) (actual time=0.003..0.005 rows=5 loops=1)

31. 0.036 0.036 ↑ 9.8 6 6

Index Scan using mdl_grougrou_gro_ix on mdl_groupings_groups grgr_1 (cost=0.28..3.81 rows=59 width=16) (actual time=0.004..0.006 rows=6 loops=6)

  • Index Cond: (groupingid = cmod.groupingid)
32. 1.014 1.014 ↓ 4.5 76 39

Index Scan using mdl_groumemb_gro_ix on mdl_groups_members grmb_1 (cost=0.28..0.83 rows=17 width=16) (actual time=0.003..0.026 rows=76 loops=39)

  • Index Cond: (groupid = grgr_1.groupid)
33. 5.962 5.962 ↑ 1.0 1 2,981

Index Scan using mdl_user_id_pk on mdl_user musr_1 (cost=0.28..0.73 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=2,981)

  • Index Cond: (id = grmb_1.userid)
34.          

SubPlan (forNested Loop)

35. 2.981 5.962 ↑ 1.0 1 2,981

Aggregate (cost=8.17..8.18 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=2,981)

36. 2.981 2.981 ↓ 0.0 0 2,981

Index Scan using mdl_deadexte_cm_staext_ix on mdl_deadline_extensions dlex (cost=0.15..8.17 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=2,981)

  • Index Cond: ((cm_id = cmod.id) AND (status = 2))
  • Filter: (student_id = musr_1.id)
  • Rows Removed by Filter: 0
37. 2.981 5.962 ↑ 1.0 1 2,981

Aggregate (cost=8.17..8.18 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=2,981)

38. 2.981 2.981 ↓ 0.0 0 2,981

Index Scan using mdl_deadexte_cm_staext_ix on mdl_deadline_extensions dlex_1 (cost=0.15..8.17 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=2,981)

  • Index Cond: ((cm_id = cmod.id) AND (status = 2) AND (ext_type = 2))
  • Filter: (student_id = 0)
39. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.03..1.04 rows=1 width=8) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Seq Scan on mdl_unisa_assessment uass2 (cost=0.00..1.02 rows=1 width=8) (never executed)

  • Filter: (cib_assessment_id = uass.cib_assessment_id)
41. 2.955 38.753 ↑ 1.0 1 2,981

Hash Left Join (cost=8.46..23.05 rows=1 width=516) (actual time=0.011..0.013 rows=1 loops=2,981)

  • Hash Cond: ((SubPlan 6) = grdl.lowerboundary)
42. 2.981 29.810 ↑ 1.0 1 2,981

Nested Loop Left Join (cost=0.29..10.76 rows=1 width=13) (actual time=0.008..0.010 rows=1 loops=2,981)

43. 20.867 20.867 ↑ 1.0 1 2,981

Seq Scan on mdl_grade_items grit (cost=0.00..2.45 rows=1 width=16) (actual time=0.005..0.007 rows=1 loops=2,981)

  • Filter: ((courseid = cmod.course) AND (iteminstance = cmod.instance))
  • Rows Removed by Filter: 29
44. 5.962 5.962 ↓ 0.0 0 2,981

Index Scan using mdl_gradgrad_useite_uix on mdl_grade_grades grds (cost=0.29..8.30 rows=1 width=13) (actual time=0.002..0.002 rows=0 loops=2,981)

  • Index Cond: ((userid = musr_1.id) AND (itemid = grit.id))
45. 0.012 0.020 ↓ 7.0 7 1

Hash (cost=8.16..8.16 rows=1 width=532) (actual time=0.020..0.020 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.008 0.008 ↓ 7.0 7 1

Index Only Scan using mdl_gradlett_conlowlet_uix on mdl_grade_letters grdl (cost=0.14..8.16 rows=1 width=532) (actual time=0.006..0.008 rows=7 loops=1)

  • Index Cond: (contextid = 1)
  • Heap Fetches: 7
47.          

SubPlan (forHash Left Join)

48. 0.000 5.968 ↑ 1.0 1 2,984

Result (cost=8.18..8.19 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=2,984)

49.          

Initplan (forResult)

50. 5.968 5.968 ↓ 0.0 0 2,984

Limit (cost=0.16..8.18 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=2,984)

51. 0.000 0.000 ↓ 0.0 0 2,984

Index Only Scan Backward using mdl_gradlett_conlowlet_uix on mdl_grade_letters grdl2 (cost=0.16..8.18 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=2,984)

  • Index Cond: ((contextid = 1) AND (lowerboundary IS NOT NULL) AND (lowerboundary <= CASE WHEN ((grit.grademax - grit.grademin) = '0'::numeric) THEN '0'::numeric ELSE round((((grds.finalgrade - grit.grademin) * '100'::numeric) / (grit.grademax - grit.grademin)), 2) END))
  • Heap Fetches: 6
52. 0.357 4,350.287 ↓ 497.0 2,982 1

Append (cost=127.01..751.67 rows=6 width=1,972) (actual time=95.766..4,350.287 rows=2,982 loops=1)

53. 0.000 98.730 ↓ 1,456.0 1,456 1

Nested Loop Left Join (cost=127.01..141.32 rows=1 width=1,948) (actual time=95.765..98.730 rows=1,456 loops=1)

  • Join Filter: ((ptfs.identifier)::text = (fils.pathnamehash)::text)
54. 0.758 97.353 ↓ 1,456.0 1,456 1

Nested Loop Left Join (cost=126.87..133.15 rows=1 width=1,437) (actual time=95.756..97.353 rows=1,456 loops=1)

  • Join Filter: (fils.userid = asde.user_id)
55. 0.566 96.595 ↓ 1,456.0 1,456 1

Merge Right Join (cost=126.59..127.03 rows=1 width=1,393) (actual time=95.753..96.595 rows=1,456 loops=1)

  • Merge Cond: ((asub.assignment = asgn.id) AND (asub.userid = asde.user_id))
56. 0.163 0.163 ↓ 1.2 170 1

Index Scan using mdl_assisubm_assusegrolat_ix on mdl_assign_submission asub (cost=0.27..58.75 rows=140 width=28) (actual time=0.104..0.163 rows=170 loops=1)

57. 4.015 95.866 ↓ 1,456.0 1,456 1

Sort (cost=126.32..126.32 rows=1 width=1,389) (actual time=95.638..95.866 rows=1,456 loops=1)

  • Sort Key: asgn.id, asde.user_id
  • Sort Method: quicksort Memory: 435kB
58. 2.614 91.851 ↓ 1,455.0 1,455 1

Nested Loop (cost=0.17..126.31 rows=1 width=1,389) (actual time=76.801..91.851 rows=1,455 loops=1)

  • Join Filter: (asde.instance_id = asgn.id)
  • Rows Removed by Join Filter: 6796
59. 1.380 80.294 ↓ 2,981.0 2,981 1

Hash Join (cost=0.04..126.08 rows=1 width=1,352) (actual time=76.792..80.294 rows=2,981 loops=1)

  • Hash Cond: ((code.moodle_course_id = asde.moodle_course_id) AND (code.user_id = asde.user_id))
60. 6.900 6.900 ↑ 4.1 1,109 1

CTE Scan on course_details code (cost=0.00..91.66 rows=4,583 width=182) (actual time=4.755..6.900 rows=1,109 loops=1)

61. 1.473 72.014 ↓ 2,981.0 2,981 1

Hash (cost=0.02..0.02 rows=1 width=1,178) (actual time=72.014..72.014 rows=2,981 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 338kB
62. 70.541 70.541 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.259..70.541 rows=2,981 loops=1)

63. 8.943 8.943 ↑ 1.0 3 2,981

Index Scan using mdl_assi_cou_ix on mdl_assign asgn (cost=0.14..0.19 rows=3 width=61) (actual time=0.001..0.003 rows=3 loops=2,981)

  • Index Cond: (course = code.moodle_course_id)
64. 0.000 0.000 ↓ 0.0 0 1,456

Index Scan using mdl_file_comfilconite_ix on mdl_files fils (cost=0.28..6.11 rows=1 width=76) (actual time=0.000..0.000 rows=0 loops=1,456)

  • Index Cond: (((component)::text = 'assignsubmission_file'::text) AND (itemid = asub.id))
  • Filter: (filesize > 0)
  • Rows Removed by Filter: 0
65. 1.456 1.456 ↓ 0.0 0 1,456

Index Scan using mdl_plagturnfile_cm_ix on mdl_plagiarism_turnitin_files ptfs (cost=0.14..8.16 rows=1 width=1,048) (actual time=0.001..0.001 rows=0 loops=1,456)

  • Index Cond: (cm = asde.course_module_id)
  • Filter: ((statuscode)::text = 'success'::text)
66. 0.000 5.113 ↓ 0.0 0 1

Nested Loop (cost=0.17..127.41 rows=1 width=1,473) (actual time=5.113..5.113 rows=0 loops=1)

  • Join Filter: (asde_1.instance_id = quiz.id)
67. 1.304 2.664 ↓ 2,981.0 2,981 1

Hash Join (cost=0.04..126.08 rows=1 width=1,352) (actual time=1.195..2.664 rows=2,981 loops=1)

  • Hash Cond: ((code_1.moodle_course_id = asde_1.moodle_course_id) AND (code_1.user_id = asde_1.user_id))
68. 0.182 0.182 ↑ 4.1 1,109 1

CTE Scan on course_details code_1 (cost=0.00..91.66 rows=4,583 width=182) (actual time=0.001..0.182 rows=1,109 loops=1)

69. 0.738 1.178 ↓ 2,981.0 2,981 1

Hash (cost=0.02..0.02 rows=1 width=1,178) (actual time=1.178..1.178 rows=2,981 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 338kB
70. 0.440 0.440 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde_1 (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.001..0.440 rows=2,981 loops=1)

71. 2.981 2.981 ↓ 0.0 0 2,981

Index Scan using mdl_quiz_cou_ix on mdl_quiz quiz (cost=0.14..0.19 rows=3 width=49) (actual time=0.001..0.001 rows=0 loops=2,981)

  • Index Cond: (course = code_1.moodle_course_id)
72.          

SubPlan (forNested Loop)

73. 0.000 0.000 ↓ 0.0 0

Limit (cost=1.10..1.10 rows=1 width=54) (never executed)

74. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.10..1.10 rows=1 width=54) (never executed)

  • Sort Key: qzat.attempt
75. 0.000 0.000 ↓ 0.0 0

Seq Scan on mdl_quiz_attempts qzat (cost=0.00..1.09 rows=1 width=54) (never executed)

  • Filter: ((quiz = quiz.id) AND (userid = asde_1.user_id))
76. 0.213 12.879 ↓ 763.0 763 1

Subquery Scan on *SELECT* 3 (cost=0.17..128.76 rows=1 width=1,476) (actual time=3.048..12.879 rows=763 loops=1)

77. 2.233 12.666 ↓ 763.0 763 1

Nested Loop (cost=0.17..128.75 rows=1 width=1,476) (actual time=3.047..12.666 rows=763 loops=1)

  • Join Filter: (asde_2.instance_id = mfrm.id)
  • Rows Removed by Join Filter: 6796
78. 1.411 2.945 ↓ 2,981.0 2,981 1

Hash Join (cost=0.04..126.08 rows=1 width=1,352) (actual time=1.323..2.945 rows=2,981 loops=1)

  • Hash Cond: ((code_2.moodle_course_id = asde_2.moodle_course_id) AND (code_2.user_id = asde_2.user_id))
79. 0.229 0.229 ↑ 4.1 1,109 1

CTE Scan on course_details code_2 (cost=0.00..91.66 rows=4,583 width=182) (actual time=0.000..0.229 rows=1,109 loops=1)

80. 0.843 1.305 ↓ 2,981.0 2,981 1

Hash (cost=0.02..0.02 rows=1 width=1,178) (actual time=1.305..1.305 rows=2,981 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 338kB
81. 0.462 0.462 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde_2 (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.000..0.462 rows=2,981 loops=1)

82. 5.962 5.962 ↓ 1.5 3 2,981

Index Scan using mdl_foru_cou_ix on mdl_forum mfrm (cost=0.14..0.18 rows=2 width=52) (actual time=0.001..0.002 rows=3 loops=2,981)

  • Index Cond: (course = code_2.moodle_course_id)
83.          

SubPlan (forNested Loop)

84. 0.000 1.526 ↑ 1.0 1 763

Aggregate (cost=2.46..2.47 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=763)

85. 0.763 1.526 ↓ 0.0 0 763

Nested Loop (cost=0.00..2.46 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=763)

  • Join Filter: (frmd.id = frmp.discussion)
86. 0.763 0.763 ↓ 0.0 0 763

Seq Scan on mdl_forum_discussions frmd (cost=0.00..1.18 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=763)

  • Filter: ((forum = mfrm.id) AND (course = asde_2.moodle_course_id))
87. 0.000 0.000 ↓ 0.0 0

Seq Scan on mdl_forum_posts frmp (cost=0.00..1.26 rows=1 width=8) (never executed)

  • Filter: (userid = asde_2.user_id)
88. 0.002 920.173 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=1.11..114.20 rows=1 width=1,972) (actual time=920.173..920.173 rows=0 loops=1)

89. 1.340 920.171 ↓ 0.0 0 1

Nested Loop (cost=1.11..114.19 rows=1 width=1,972) (actual time=920.171..920.171 rows=0 loops=1)

  • Join Filter: ((code_3.moodle_course_id = asde_3.moodle_course_id) AND (code_3.user_id = asde_3.user_id) AND (lssn.id = asde_3.instance_id))
90. 0.683 0.683 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde_3 (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.000..0.683 rows=2,981 loops=1)

91. 423.295 918.148 ↓ 0.0 0 2,981

Hash Join (cost=1.11..111.11 rows=115 width=730) (actual time=0.308..0.308 rows=0 loops=2,981)

  • Hash Cond: (code_3.moodle_course_id = lssn.course)
92. 494.846 494.846 ↑ 4.1 1,109 2,981

CTE Scan on course_details code_3 (cost=0.00..91.66 rows=4,583 width=182) (actual time=0.000..0.166 rows=1,109 loops=2,981)

93. 0.001 0.007 ↑ 5.0 1 1

Hash (cost=1.05..1.05 rows=5 width=548) (actual time=0.007..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
94. 0.006 0.006 ↑ 5.0 1 1

Seq Scan on mdl_lesson lssn (cost=0.00..1.05 rows=5 width=548) (actual time=0.005..0.006 rows=1 loops=1)

95.          

SubPlan (forNested Loop)

96. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.03..1.04 rows=1 width=32) (never executed)

97. 0.000 0.000 ↓ 0.0 0

Seq Scan on mdl_lesson_timer lsnt (cost=0.00..1.03 rows=1 width=8) (never executed)

  • Filter: ((lessonid = lssn.id) AND (userid = asde_3.user_id))
98. 0.319 1,928.963 ↓ 763.0 763 1

Subquery Scan on *SELECT* 5 (cost=2.11..126.84 rows=1 width=1,972) (actual time=518.474..1,928.963 rows=763 loops=1)

99. 419.327 1,928.644 ↓ 763.0 763 1

Nested Loop (cost=2.11..126.83 rows=1 width=1,972) (actual time=518.472..1,928.644 rows=763 loops=1)

  • Join Filter: ((code_4.moodle_course_id = asde_4.moodle_course_id) AND (code_4.user_id = asde_4.user_id) AND (mdat.id = asde_4.instance_id))
  • Rows Removed by Join Filter: 2273740
100. 0.860 0.860 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde_4 (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.001..0.860 rows=2,981 loops=1)

101. 998.614 1,505.405 ↓ 6.6 763 2,981

Hash Join (cost=2.11..112.11 rows=115 width=730) (actual time=0.098..0.505 rows=763 loops=2,981)

  • Hash Cond: (code_4.moodle_course_id = mdat.course)
102. 506.770 506.770 ↑ 4.1 1,109 2,981

CTE Scan on course_details code_4 (cost=0.00..91.66 rows=4,583 width=182) (actual time=0.000..0.170 rows=1,109 loops=2,981)

103. 0.003 0.021 ↑ 2.5 2 1

Hash (cost=2.05..2.05 rows=5 width=548) (actual time=0.021..0.021 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
104. 0.018 0.018 ↑ 2.5 2 1

Seq Scan on mdl_data mdat (cost=0.00..2.05 rows=5 width=548) (actual time=0.017..0.018 rows=2 loops=1)

105.          

SubPlan (forNested Loop)

106. 1.526 3.052 ↑ 1.0 1 763

Aggregate (cost=12.68..12.69 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=763)

107. 0.763 1.526 ↓ 0.0 0 763

Bitmap Heap Scan on mdl_data_records dtar (cost=4.19..12.68 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=763)

  • Recheck Cond: (dataid = mdat.id)
  • Filter: (userid = asde_4.user_id)
108. 0.763 0.763 ↓ 0.0 0 763

Bitmap Index Scan on mdl_datareco_dat_ix (cost=0.00..4.19 rows=5 width=0) (actual time=0.001..0.001 rows=0 loops=763)

  • Index Cond: (dataid = mdat.id)
109. 0.001 1,384.072 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=1.07..113.12 rows=1 width=1,972) (actual time=1,384.072..1,384.072 rows=0 loops=1)

110. 149.078 1,384.071 ↓ 0.0 0 1

Nested Loop (cost=1.07..113.11 rows=1 width=1,972) (actual time=1,384.071..1,384.071 rows=0 loops=1)

  • Join Filter: ((code_5.moodle_course_id = asde_5.moodle_course_id) AND (code_5.user_id = asde_5.user_id) AND (scrm.id = asde_5.instance_id))
  • Rows Removed by Join Filter: 1031426
111. 0.859 0.859 ↓ 2,981.0 2,981 1

CTE Scan on assessment_details asde_5 (cost=0.00..0.02 rows=1 width=1,178) (actual time=0.000..0.859 rows=2,981 loops=1)

112. 715.419 1,234.134 ↓ 5.0 346 2,981

Hash Join (cost=1.07..110.60 rows=69 width=730) (actual time=0.001..0.414 rows=346 loops=2,981)

  • Hash Cond: (code_5.moodle_course_id = scrm.course)
113. 518.694 518.694 ↑ 4.1 1,109 2,981

CTE Scan on course_details code_5 (cost=0.00..91.66 rows=4,583 width=182) (actual time=0.000..0.174 rows=1,109 loops=2,981)

114. 0.004 0.021 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=548) (actual time=0.021..0.021 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
115. 0.017 0.017 ↑ 1.0 3 1

Seq Scan on mdl_scorm scrm (cost=0.00..1.03 rows=3 width=548) (actual time=0.015..0.017 rows=3 loops=1)

116.          

SubPlan (forNested Loop)

117. 0.000 0.000 ↓ 0.0 0

Seq Scan on mdl_scorm_scoes_track sstr (cost=0.00..1.28 rows=1 width=32) (never executed)

  • Filter: ((scormid = scrm.id) AND (userid = asde_5.user_id) AND ((element)::text = 'cmi.core.lesson_status'::text))
Planning time : 7.467 ms
Execution time : 4,357.529 ms