explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SDgq

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

Unique (cost=170,525,267,618.54..170,525,268,240.02 rows=82,865 width=36) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=170,525,267,618.54..170,525,267,825.70 rows=82,865 width=36) (actual rows= loops=)

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

GroupAggregate (cost=170,525,224,148.28..170,525,258,581.10 rows=82,865 width=36) (actual rows= loops=)

  • Group Key: mw1.sid
  • Filter: (avg(cr.grade) >= '9'::numeric)
4. 0.000 0.000 ↓ 0.0

Sort (cost=170,525,224,148.28..170,525,232,445.74 rows=3,318,984 width=6) (actual rows= loops=)

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

Nested Loop (cost=0.57..170,524,773,908.98 rows=3,318,984 width=6) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Seq Scan on mw1 (cost=0.00..170,520,875,022.53 rows=91,334 width=8) (actual rows= loops=)

  • Filter: (NOT (SubPlan 1))
7.          

SubPlan (forSeq Scan)

8. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1,770,779.67 rows=38,485,333 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on course_registrations cr2 (cost=0.00..1,428,019.00 rows=38,485,333 width=4) (actual rows= loops=)

  • Filter: (grade < 5)
10. 0.000 0.000 ↓ 0.0

Index Scan using rid on course_registrations cr (cost=0.57..42.33 rows=36 width=6) (actual rows= loops=)

  • Index Cond: (rid = mw1.rid)