explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cjbk

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 1,081.187 ↑ 1.7 33 1

GroupAggregate (cost=150,781.74..150,783.02 rows=57 width=69) (actual time=1,081.169..1,081.187 rows=33 loops=1)

  • Group Key: cb.id, bd.id
2. 0.019 1,081.158 ↑ 1.7 33 1

Sort (cost=150,781.74..150,781.88 rows=57 width=45) (actual time=1,081.158..1,081.158 rows=33 loops=1)

  • Sort Key: cb.id, bd.id
  • Sort Method: quicksort Memory: 27kB
3. 150.135 1,081.139 ↑ 1.7 33 1

Hash Right Join (cost=90,655.12..150,780.08 rows=57 width=45) (actual time=992.407..1,081.139 rows=33 loops=1)

  • Hash Cond: (bd.scenario_id = s.id)
4. 277.311 277.311 ↓ 1.0 1,604,756 1

Seq Scan on bid_drugs bd (cost=0.00..54,107.10 rows=1,604,610 width=29) (actual time=0.082..277.311 rows=1,604,756 loops=1)

5. 0.011 653.693 ↑ 1.7 14 1

Hash (cost=90,654.82..90,654.82 rows=24 width=32) (actual time=653.693..653.693 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 148.337 653.682 ↑ 1.7 14 1

Hash Right Join (cost=30,529.86..90,654.82 rows=24 width=32) (actual time=653.677..653.682 rows=14 loops=1)

  • Hash Cond: (bd2.scenario_id = s2.id)
  • Join Filter: (s2.dependency_id IS NOT NULL)
7. 272.512 272.512 ↓ 1.0 1,604,756 1

Seq Scan on bid_drugs bd2 (cost=0.00..54,107.10 rows=1,604,610 width=16) (actual time=0.040..272.512 rows=1,604,756 loops=1)

8. 0.007 232.833 ↑ 1.7 14 1

Hash (cost=30,529.56..30,529.56 rows=24 width=40) (actual time=232.833..232.833 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 37.095 232.826 ↑ 1.7 14 1

Hash Right Join (cost=15,548.42..30,529.56 rows=24 width=40) (actual time=232.821..232.826 rows=14 loops=1)

  • Hash Cond: (s2.dependency_id = s.dependency_id)
10. 68.109 68.109 ↑ 1.0 678,027 1

Seq Scan on scenarios s2 (cost=0.00..12,438.46 rows=678,046 width=16) (actual time=0.014..68.109 rows=678,027 loops=1)

11. 0.008 127.622 ↑ 1.7 14 1

Hash (cost=15,548.12..15,548.12 rows=24 width=32) (actual time=127.622..127.622 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 58.994 127.614 ↑ 1.7 14 1

Hash Right Join (cost=566.75..15,548.12 rows=24 width=32) (actual time=89.712..127.614 rows=14 loops=1)

  • Hash Cond: (s.cb_id = cb.id)
13. 66.018 66.018 ↑ 1.0 678,027 1

Seq Scan on scenarios s (cost=0.00..12,438.46 rows=678,046 width=24) (actual time=0.012..66.018 rows=678,027 loops=1)

14. 0.001 2.602 ↑ 1.0 1 1

Hash (cost=566.74..566.74 rows=1 width=16) (actual time=2.602..2.602 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 2.601 2.601 ↑ 1.0 1 1

Seq Scan on contracted_businesses cb (cost=0.00..566.74 rows=1 width=16) (actual time=0.014..2.601 rows=1 loops=1)

  • Filter: (bid_version_id = 1)
  • Rows Removed by Filter: 28778
Planning time : 0.475 ms
Execution time : 1,081.246 ms