explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iJtKg

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 133.892 ↓ 0.0 0 1

GroupAggregate (cost=150,778.41..150,778.46 rows=2 width=69) (actual time=133.892..133.892 rows=0 loops=1)

  • Group Key: cb.id, bd.id
2. 0.005 133.891 ↓ 0.0 0 1

Sort (cost=150,778.41..150,778.42 rows=2 width=45) (actual time=133.891..133.891 rows=0 loops=1)

  • Sort Key: cb.id, bd.id
  • Sort Method: quicksort Memory: 25kB
3. 0.005 133.886 ↓ 0.0 0 1

Hash Join (cost=90,654.00..150,778.40 rows=2 width=45) (actual time=133.886..133.886 rows=0 loops=1)

  • Hash Cond: (bd.scenario_id = s.id)
4. 0.039 0.039 ↑ 1,604,610.0 1 1

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

5. 0.000 133.842 ↓ 0.0 0 1

Hash (cost=90,653.98..90,653.98 rows=1 width=32) (actual time=133.842..133.842 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
6. 0.003 133.842 ↓ 0.0 0 1

Hash Right Join (cost=30,529.58..90,653.98 rows=1 width=32) (actual time=133.842..133.842 rows=0 loops=1)

  • Hash Cond: (bd2.scenario_id = s2.id)
  • Join Filter: (s2.dependency_id IS NOT NULL)
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on bid_drugs bd2 (cost=0.00..54,107.10 rows=1,604,610 width=16) (never executed)

8. 0.000 133.839 ↓ 0.0 0 1

Hash (cost=30,529.56..30,529.56 rows=1 width=40) (actual time=133.839..133.839 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.002 133.839 ↓ 0.0 0 1

Hash Join (cost=15,548.42..30,529.56 rows=1 width=40) (actual time=133.839..133.839 rows=0 loops=1)

  • Hash Cond: (s2.dependency_id = s.dependency_id)
10. 0.009 0.009 ↑ 678,046.0 1 1

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

11. 0.002 133.828 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
12. 60.676 133.826 ↑ 1.7 14 1

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

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

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

14. 0.001 2.474 ↑ 1.0 1 1

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

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

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

  • Filter: (bid_version_id = 1)
  • Rows Removed by Filter: 28778