explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8MWs

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

WindowAgg (cost=102,035,539.55..104,105,673.63 rows=59,146,688 width=69) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=102,035,539.55..102,183,406.27 rows=59,146,688 width=57) (actual rows= loops=)

  • Sort Key: school._id_, learner_attendance_update._tstamp_ DESC
3. 0.000 0.000 ↓ 0.0

Group (cost=84,779,879.84..92,176,577.00 rows=59,146,688 width=57) (actual rows= loops=)

  • Group Key: school._id_, learner_attendance_update.male, learner_attendance_update.female, learner_attendance_update.year, learner_attendance_update.month, learner_attendance_update.day, learner_attendance_update._tstamp_
4. 0.000 0.000 ↓ 0.0

Sort (cost=84,779,879.84..85,704,466.99 rows=369,834,858 width=57) (actual rows= loops=)

  • Sort Key: school._id_, learner_attendance_update.male, learner_attendance_update.female, learner_attendance_update.year, learner_attendance_update.month, learner_attendance_update.day, learner_attendance_update._tstamp_
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=14,254.05..4,338,263.41 rows=369,834,858 width=57) (actual rows= loops=)

  • Hash Cond: (grade_classrooms.grade_fk = learner_attendance_update.grade_fk)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,467.18..5,929.49 rows=13,881 width=48) (actual rows= loops=)

  • Hash Cond: (grade_classrooms.school_fk = school._id_)
7. 0.000 0.000 ↓ 0.0

Seq Scan on grade_classrooms (cost=0.00..3,425.81 rows=13,881 width=32) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=2,429.86..2,429.86 rows=2,986 width=32) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on school (cost=0.00..2,429.86 rows=2,986 width=32) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash (cost=9,310.83..9,310.83 rows=198,083 width=41) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on learner_attendance_update (cost=0.00..9,310.83 rows=198,083 width=41) (actual rows= loops=)