explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DcAv : Optimization for: Optimization for: Optimization for: Optimization for: plan #fh1o; plan #deTh; plan #7vTb; plan #I063

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,928.618 2,655.168 ↑ 1.0 6,000,479 1

Hash Left Join (cost=4,124.23..246,862.17 rows=6,062,275 width=95) (actual time=43.342..2,655.168 rows=6,000,479 loops=1)

  • Hash Cond: ((s.ts_id = (COALESCE((b.value ->> 'boost_id'::text), '0'::text))::integer) AND ((s.widget_id)::text = (b.value ->> 'widget_id'::text)))
2. 683.240 683.240 ↑ 1.0 6,000,479 1

Seq Scan on widget_status s (cost=0.00..106,336.75 rows=6,062,275 width=30) (actual time=0.015..683.240 rows=6,000,479 loops=1)

3. 1.095 43.310 ↓ 1,012.0 1,012 1

Hash (cost=4,124.21..4,124.21 rows=1 width=93) (actual time=43.310..43.310 rows=1,012 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 138kB
4. 5.568 42.215 ↓ 1,497.0 1,497 1

Hash Join (cost=2,934.28..4,124.21 rows=1 width=93) (actual time=28.290..42.215 rows=1,497 loops=1)

  • Hash Cond: (((block_history.key)::text = (b.key)::text) AND ((max(block_history.seq)) = b.seq))
5. 22.204 25.615 ↑ 1.0 41,764 1

HashAggregate (cost=1,464.51..1,897.21 rows=43,270 width=17) (actual time=17.191..25.615 rows=41,764 loops=1)

  • Group Key: block_history.key
6. 3.411 3.411 ↑ 1.1 44,254 1

Seq Scan on block_history (cost=0.00..1,230.67 rows=46,767 width=17) (actual time=0.005..3.411 rows=44,254 loops=1)

7. 0.743 11.032 ↓ 9.1 2,126 1

Hash (cost=1,466.26..1,466.26 rows=234 width=97) (actual time=11.032..11.032 rows=2,126 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 305kB
8. 10.289 10.289 ↓ 9.1 2,126 1

Seq Scan on block_history b (cost=0.00..1,466.26 rows=234 width=97) (actual time=0.107..10.289 rows=2,126 loops=1)

  • Filter: ((value ->> 'blocked'::text) = 'false'::text)
  • Rows Removed by Filter: 42128
Planning time : 0.628 ms
Execution time : 2,811.029 ms