explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yyjY : Alextest4

Settings
# exclusive inclusive rows x rows loops node
1. 47.697 135,107.458 ↓ 261,912.0 261,912 1

Unique (cost=2,140.27..2,140.28 rows=1 width=32) (actual time=135,029.658..135,107.458 rows=261,912 loops=1)

2. 488.609 135,059.761 ↓ 263,670.0 263,670 1

Sort (cost=2,140.27..2,140.27 rows=1 width=32) (actual time=135,029.658..135,059.761 rows=263,670 loops=1)

  • Sort Key: c.id, cr.id, ra.userid, mc.timemodified
  • Sort Method: external sort Disk: 10832kB
3. 669.234 134,571.152 ↓ 263,670.0 263,670 1

Nested Loop Left Join (cost=2.42..2,140.26 rows=1 width=32) (actual time=0.325..134,571.152 rows=263,670 loops=1)

  • Join Filter: (cc.criteriaid = cr.id)
  • Rows Removed by Join Filter: 4507974
4. 15,119.758 131,528.888 ↓ 263,670.0 263,670 1

Nested Loop (cost=2.00..2,139.50 rows=1 width=32) (actual time=0.316..131,528.888 rows=263,670 loops=1)

  • Join Filter: (cr.moduleinstance = mc.coursemoduleid)
  • Rows Removed by Join Filter: 175230686
5. 270.574 852.831 ↓ 98,935.2 1,582,963 1

Nested Loop (cost=1.44..2,027.18 rows=16 width=32) (actual time=0.103..852.831 rows=1,582,963 loops=1)

6. 2.499 40.475 ↓ 125.5 2,133 1

Nested Loop (cost=1.00..1,748.06 rows=17 width=32) (actual time=0.097..40.475 rows=2,133 loops=1)

  • Join Filter: (cr.course = c.id)
7. 4.157 29.180 ↓ 81.4 2,199 1

Merge Join (cost=0.71..1,738.64 rows=27 width=40) (actual time=0.087..29.180 rows=2,199 loops=1)

  • Merge Cond: (con.instanceid = cr.course)
8. 22.776 22.776 ↓ 1.0 39,502 1

Index Only Scan using alextest1 on mdl_context con (cost=0.43..55,759.04 rows=39,284 width=16) (actual time=0.011..22.776 rows=39,502 loops=1)

  • Index Cond: (contextlevel = 50)
  • Heap Fetches: 27164
9. 2.247 2.247 ↓ 1.0 2,199 1

Index Scan using mdl_courcompcrit_cou_ix on mdl_course_completion_criteria cr (cost=0.28..115.77 rows=2,198 width=24) (actual time=0.010..2.247 rows=2,199 loops=1)

  • Filter: (criteriatype = 4)
  • Rows Removed by Filter: 255
10. 8.796 8.796 ↑ 1.0 1 2,199

Index Only Scan using alextest2 on mdl_course c (cost=0.29..0.34 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=2,199)

  • Index Cond: ((enablecompletion = 1) AND (id = con.instanceid))
  • Heap Fetches: 148
11. 541.782 541.782 ↓ 2.4 742 2,133

Index Scan using mdl_roleassi_con_ix on mdl_role_assignments ra (cost=0.43..13.36 rows=306 width=16) (actual time=0.005..0.254 rows=742 loops=2,133)

  • Index Cond: (contextid = con.id)
12. 115,556.299 115,556.299 ↑ 1.9 111 1,582,963

Index Scan using mdl_courmoducomp_usecou_uix on mdl_course_modules_completion mc (cost=0.56..4.38 rows=211 width=24) (actual time=0.005..0.073 rows=111 loops=1,582,963)

  • Index Cond: (userid = ra.userid)
13. 2,373.030 2,373.030 ↓ 1.6 18 263,670

Index Scan using mdl_courcompcritcomp_use_ix on mdl_course_completion_crit_compl cc (cost=0.42..0.62 rows=11 width=16) (actual time=0.003..0.009 rows=18 loops=263,670)

  • Index Cond: (userid = ra.userid)