explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OfMC

Settings
# exclusive inclusive rows x rows loops node
1. 0.178 608.480 ↑ 1.0 174 1

Sort (cost=191,609.38..191,609.82 rows=174 width=233) (actual time=608.468..608.480 rows=174 loops=1)

  • Sort Key: (min(base.id))
  • Sort Method: quicksort Memory: 103kB
2. 417.434 608.302 ↑ 1.0 174 1

GroupAggregate (cost=16,836.32..191,602.91 rows=174 width=233) (actual time=70.494..608.302 rows=174 loops=1)

  • Group Key: base.id
3. 75.913 190.868 ↓ 1.2 392,140 1

Merge Left Join (cost=16,836.32..22,202.82 rows=335,270 width=146) (actual time=69.837..190.868 rows=392,140 loops=1)

  • Merge Cond: (base.id = completion.itemid)
4. 0.268 1.039 ↓ 1.0 439 1

Sort (cost=68.91..70.00 rows=435 width=134) (actual time=0.968..1.039 rows=439 loops=1)

  • Sort Key: base.id
  • Sort Method: quicksort Memory: 126kB
5. 0.144 0.771 ↓ 1.0 439 1

Hash Left Join (cost=40.18..49.84 rows=435 width=134) (actual time=0.392..0.771 rows=439 loops=1)

  • Hash Cond: (audience_assign.cohortid = audience.id)
6. 0.197 0.398 ↓ 1.0 439 1

Hash Right Join (cost=14.92..23.43 rows=435 width=111) (actual time=0.158..0.398 rows=439 loops=1)

  • Hash Cond: (audience_assign.itemid = base.id)
7. 0.054 0.054 ↑ 1.0 435 1

Seq Scan on mdl_local_competency_cohort_assign audience_assign (cost=0.00..7.35 rows=435 width=16) (actual time=0.005..0.054 rows=435 loops=1)

8. 0.066 0.147 ↑ 1.0 174 1

Hash (cost=12.74..12.74 rows=174 width=103) (actual time=0.146..0.147 rows=174 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
9. 0.081 0.081 ↑ 1.0 174 1

Seq Scan on mdl_local_competency_item base (cost=0.00..12.74 rows=174 width=103) (actual time=0.009..0.081 rows=174 loops=1)

10. 0.114 0.229 ↑ 1.0 545 1

Hash (cost=18.45..18.45 rows=545 width=39) (actual time=0.229..0.229 rows=545 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
11. 0.115 0.115 ↑ 1.0 545 1

Seq Scan on mdl_cohort audience (cost=0.00..18.45 rows=545 width=39) (actual time=0.004..0.115 rows=545 loops=1)

12. 27.381 113.916 ↓ 2.9 392,125 1

Materialize (cost=16,767.41..17,437.95 rows=134,108 width=20) (actual time=68.862..113.916 rows=392,125 loops=1)

13. 66.186 86.535 ↑ 1.0 134,108 1

Sort (cost=16,767.41..17,102.68 rows=134,108 width=20) (actual time=68.859..86.535 rows=134,108 loops=1)

  • Sort Key: completion.itemid
  • Sort Method: external merge Disk: 4464kB
14. 20.349 20.349 ↑ 1.0 134,108 1

Seq Scan on mdl_local_competency_completion completion (cost=0.00..2,595.08 rows=134,108 width=20) (actual time=0.007..20.349 rows=134,108 loops=1)