explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X5Gk

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

Unique (cost=3,293,210.86..3,294,245.80 rows=137,992 width=36) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=3,293,210.86..3,293,555.84 rows=137,992 width=36) (actual rows= loops=)

  • Sort Key: mw1.sid, (avg(cr.grade))
3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=3,159,418.88..3,277,653.83 rows=137,992 width=36) (actual rows= loops=)

  • Group Key: mw1.sid
  • Filter: ((avg(cr.grade) >= '9'::numeric) AND (count(*) = count(cr.grade) FILTER (WHERE (cr.grade >= 5))))
4. 0.000 0.000 ↓ 0.0

Sort (cost=3,159,418.88..3,176,013.89 rows=6,638,004 width=6) (actual rows= loops=)

  • Sort Key: mw1.sid
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,633.05..2,225,746.09 rows=6,638,004 width=6) (actual rows= loops=)

  • Hash Cond: (cr.rid = mw1.rid)
6. 0.000 0.000 ↓ 0.0

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

7. 0.000 0.000 ↓ 0.0

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

8. 0.000 0.000 ↓ 0.0

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