explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CuO7

Settings
# exclusive inclusive rows x rows loops node
1. 33.793 9,118.540 ↓ 8,757.0 8,757 1

Group (cost=9,126.16..9,126.17 rows=1 width=8) (actual time=8,977.535..9,118.540 rows=8,757 loops=1)

  • Group Key: c.id
2. 549.421 9,084.747 ↓ 395,569.0 395,569 1

Sort (cost=9,126.16..9,126.16 rows=1 width=8) (actual time=8,977.534..9,084.747 rows=395,569 loops=1)

  • Sort Key: c.id
  • Sort Method: external merge Disk: 6952kB
3. 1,175.277 8,535.326 ↓ 395,569.0 395,569 1

Nested Loop (cost=1,365.72..9,126.15 rows=1 width=8) (actual time=18.202..8,535.326 rows=395,569 loops=1)

  • Join Filter: (c.id = e.courseid)
  • Rows Removed by Join Filter: 1656255
4. 479.772 3,256.401 ↓ 562.9 2,051,824 1

Nested Loop (cost=1,365.44..7,940.78 rows=3,645 width=24) (actual time=18.195..3,256.401 rows=2,051,824 loops=1)

5. 59.652 682.857 ↓ 519.3 348,962 1

Nested Loop (cost=1,365.01..7,540.38 rows=672 width=24) (actual time=18.185..682.857 rows=348,962 loops=1)

6. 11.908 58.649 ↓ 17.4 10,652 1

Hash Join (cost=1,364.59..4,768.61 rows=613 width=24) (actual time=18.075..58.649 rows=10,652 loops=1)

  • Hash Cond: (con.instanceid = c.id)
7. 29.030 30.323 ↓ 1.0 10,652 1

Bitmap Heap Scan on mdl_context con (cost=245.92..3,604.37 rows=10,516 width=16) (actual time=1.554..30.323 rows=10,652 loops=1)

  • Recheck Cond: (contextlevel = 50)
  • Heap Blocks: exact=1531
8. 1.293 1.293 ↓ 1.0 10,652 1

Bitmap Index Scan on mdl_cont_conins_uix (cost=0.00..243.29 rows=10,516 width=0) (actual time=1.293..1.293 rows=10,652 loops=1)

  • Index Cond: (contextlevel = 50)
9. 2.590 16.418 ↑ 1.0 10,652 1

Hash (cost=985.52..985.52 rows=10,652 width=8) (actual time=16.418..16.418 rows=10,652 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 545kB
10. 13.828 13.828 ↑ 1.0 10,652 1

Seq Scan on mdl_course c (cost=0.00..985.52 rows=10,652 width=8) (actual time=0.021..13.828 rows=10,652 loops=1)

11. 564.556 564.556 ↑ 1.9 33 10,652

Index Scan using mdl_roleassi_con_ix on mdl_role_assignments ra (cost=0.42..3.90 rows=62 width=16) (actual time=0.007..0.053 rows=33 loops=10,652)

  • Index Cond: (contextid = con.id)
  • Filter: (roleid = 13)
  • Rows Removed by Filter: 2
12. 2,093.772 2,093.772 ↓ 1.5 6 348,962

Index Scan using mdl_userenro_use_ix on mdl_user_enrolments ue (cost=0.42..0.56 rows=4 width=16) (actual time=0.003..0.006 rows=6 loops=348,962)

  • Index Cond: (userid = ra.userid)
13. 4,103.648 4,103.648 ↑ 1.0 1 2,051,824

Index Scan using mdl_enro_id_pk on mdl_enrol e (cost=0.29..0.31 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=2,051,824)

  • Index Cond: (id = ue.enrolid)
Planning time : 2.702 ms