explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tg7D

Settings
# exclusive inclusive rows x rows loops node
1. 0.175 100,221.859 ↑ 520.7 265 1

Unique (cost=3,293,210.86..3,294,245.80 rows=137,992 width=36) (actual time=100,221.643..100,221.859 rows=265 loops=1)

2. 0.395 100,221.684 ↑ 520.7 265 1

Sort (cost=3,293,210.86..3,293,555.84 rows=137,992 width=36) (actual time=100,221.642..100,221.684 rows=265 loops=1)

  • Sort Key: mw1.sid, (avg(cr.grade))
  • Sort Method: quicksort Memory: 42kB
3. 5,104.755 100,221.289 ↑ 520.7 265 1

GroupAggregate (cost=3,159,418.88..3,277,653.83 rows=137,992 width=36) (actual time=91,523.611..100,221.289 rows=265 loops=1)

  • Group Key: mw1.sid
  • Filter: ((avg(cr.grade) >= '9'::numeric) AND (count(*) = count(cr.grade) FILTER (WHERE (cr.grade >= 5))))
  • Rows Removed by Filter: 154337
4. 22,084.310 95,116.534 ↓ 2.2 14,400,617 1

Sort (cost=3,159,418.88..3,176,013.89 rows=6,638,004 width=6) (actual time=91,502.654..95,116.534 rows=14,400,617 loops=1)

  • Sort Key: mw1.sid
  • Sort Method: external merge Disk: 224104kB
5. 46,836.292 73,032.224 ↓ 2.2 14,400,617 1

Hash Join (cost=5,633.05..2,225,746.09 rows=6,638,004 width=6) (actual time=110.486..73,032.224 rows=14,400,617 loops=1)

  • Hash Cond: (cr.rid = mw1.rid)
6. 26,087.812 26,087.812 ↑ 1.0 80,000,000 1

Seq Scan on course_registrations cr (cost=0.00..1,228,019.00 rows=80,000,000 width=6) (actual time=0.047..26,087.812 rows=80,000,000 loops=1)

7. 62.423 108.120 ↑ 1.0 182,669 1

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

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

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