explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ws1O

Settings
# exclusive inclusive rows x rows loops node
1. 1.521 1,593.085 ↓ 11.0 11 1

GroupAggregate (cost=219,399.29..219,399.31 rows=1 width=24) (actual time=1,591.579..1,593.085 rows=11 loops=1)

  • Group Key: cm.id
2. 1.602 1,591.564 ↓ 6,880.0 6,880 1

Sort (cost=219,399.29..219,399.29 rows=1 width=16) (actual time=1,591.233..1,591.564 rows=6,880 loops=1)

  • Sort Key: cm.id
  • Sort Method: quicksort Memory: 515kB
3. 0.000 1,589.962 ↓ 6,880.0 6,880 1

Nested Loop (cost=206,588.84..219,399.28 rows=1 width=16) (actual time=1,281.307..1,589.962 rows=6,880 loops=1)

4. 11.505 1,576.661 ↓ 6,880.0 6,880 1

Nested Loop (cost=206,588.55..219,391.32 rows=1 width=24) (actual time=1,281.298..1,576.661 rows=6,880 loops=1)

5. 11.177 1,328.513 ↓ 5,634.4 78,881 1

Nested Loop (cost=206,587.85..219,269.03 rows=14 width=24) (actual time=1,281.154..1,328.513 rows=78,881 loops=1)

6. 46.790 1,288.652 ↓ 7,171.0 7,171 1

Merge Join (cost=206,587.42..219,037.42 rows=1 width=16) (actual time=1,281.134..1,288.652 rows=7,171 loops=1)

  • Merge Cond: (mdl_role_assignments.contextid = c.id)
7. 108.595 1,241.811 ↓ 5.1 762,025 1

Unique (cost=206,578.97..217,163.56 rows=149,231 width=16) (actual time=1,026.890..1,241.811 rows=762,025 loops=1)

8. 884.409 1,133.216 ↑ 1.7 853,381 1

Sort (cost=206,578.97..210,107.17 rows=1,411,279 width=16) (actual time=1,026.889..1,133.216 rows=853,381 loops=1)

  • Sort Key: mdl_role_assignments.contextid, mdl_role_assignments.userid
  • Sort Method: external merge Disk: 36008kB
9. 248.807 248.807 ↓ 1.0 1,412,193 1

Seq Scan on mdl_role_assignments (cost=0.00..38,304.90 rows=1,411,279 width=16) (actual time=0.011..248.807 rows=1,412,193 loops=1)

  • Filter: (roleid = 5)
  • Rows Removed by Filter: 80118
10. 0.009 0.051 ↓ 2.0 2 1

Sort (cost=8.45..8.46 rows=1 width=16) (actual time=0.050..0.051 rows=2 loops=1)

  • Sort Key: c.id
  • Sort Method: quicksort Memory: 25kB
11. 0.042 0.042 ↓ 2.0 2 1

Index Scan using mdl_cont_ins_ix on mdl_context c (cost=0.42..8.44 rows=1 width=16) (actual time=0.037..0.042 rows=2 loops=1)

  • Index Cond: (instanceid = 3912)
12. 28.684 28.684 ↑ 8.3 11 7,171

Index Scan using mdl_courmodu_cou_ix on mdl_course_modules cm (cost=0.42..230.70 rows=91 width=8) (actual time=0.002..0.004 rows=11 loops=7,171)

  • Index Cond: (course = 3912)
13. 236.643 236.643 ↓ 0.0 0 78,881

Index Scan using mdl_logsstanlog_useconconcr_ix on mdl_logstore_standard_log l (cost=0.70..8.72 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=78,881)

  • Index Cond: ((userid = mdl_role_assignments.userid) AND (contextlevel = 70) AND (contextinstanceid = cm.id))
  • Filter: ((courseid = 3912) AND ((action)::text = 'viewed'::text))
  • Rows Removed by Filter: 0
14. 13.760 13.760 ↑ 1.0 1 6,880

Index Scan using mdl_user_id_pk on mdl_user u (cost=0.29..7.96 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=6,880)

  • Index Cond: (id = mdl_role_assignments.userid)
  • Filter: (deleted = 0)