explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CiYM

Settings
# exclusive inclusive rows x rows loops node
1. 105.863 67,379.604 ↑ 5.1 271,250 1

Unique (cost=3,204,994.54..3,215,343.94 rows=1,379,920 width=38) (actual time=67,230.744..67,379.604 rows=271,250 loops=1)

2. 412.294 67,273.741 ↑ 5.1 271,250 1

Sort (cost=3,204,994.54..3,208,444.34 rows=1,379,920 width=38) (actual time=67,230.742..67,273.741 rows=271,250 loops=1)

  • Sort Key: mw1.sid, (avg(cr.grade))
  • Sort Method: external sort Disk: 5840kB
3. 2,509.810 66,861.447 ↑ 5.1 271,250 1

GroupAggregate (cost=2,928,819.69..2,988,802.24 rows=1,379,920 width=38) (actual time=62,218.437..66,861.447 rows=271,250 loops=1)

  • Group Key: mw1.sid, cr.grade
  • Filter: (avg(cr.grade) >= '9'::numeric)
  • Rows Removed by Filter: 603305
4. 11,994.317 64,351.637 ↓ 2.3 7,083,110 1

Sort (cost=2,928,819.69..2,936,676.44 rows=3,142,700 width=6) (actual time=62,218.399..64,351.637 rows=7,083,110 loops=1)

  • Sort Key: mw1.sid, cr.grade
  • Sort Method: external merge Disk: 110920kB
5. 20,574.901 52,357.320 ↓ 2.3 7,083,110 1

Hash Join (cost=5,633.05..2,503,727.22 rows=3,142,700 width=6) (actual time=102.608..52,357.320 rows=7,083,110 loops=1)

  • Hash Cond: (cr.rid = mw1.rid)
6. 31,681.985 31,681.985 ↑ 1.0 37,498,242 1

Seq Scan on course_registrations cr (cost=0.00..2,028,019.00 rows=37,875,244 width=6) (actual time=0.016..31,681.985 rows=37,498,242 loops=1)

  • Filter: ((grade <> 1) AND (grade <> 2) AND (grade <> 3) AND (grade <> 4))
  • Rows Removed by Filter: 42501758
7. 56.406 100.434 ↑ 1.0 182,669 1

Hash (cost=2,635.69..2,635.69 rows=182,669 width=8) (actual time=100.434..100.434 rows=182,669 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 2813kB
8. 44.028 44.028 ↑ 1.0 182,669 1

Seq Scan on mw1 (cost=0.00..2,635.69 rows=182,669 width=8) (actual time=0.072..44.028 rows=182,669 loops=1)