explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3,265.293 6,124.946 ↑ 1.0 6,000,479 1

Sort (cost=1,596,907.04..1,612,062.73 rows=6,062,275 width=95) (actual time=5,315.472..6,124.946 rows=6,000,479 loops=1)

  • Sort Key: (COALESCE(date_part('day'::text, (now() - b.ts)), '2147483647'::double precision)) DESC
  • Sort Method: external sort Disk: 340464kB
2. 2,050.292 2,859.653 ↑ 1.0 6,000,479 1

Hash Left Join (cost=4,122.47..292,327.48 rows=6,062,275 width=95) (actual time=50.596..2,859.653 rows=6,000,479 loops=1)

  • Hash Cond: ((s.ts_id = ((b.value ->> 'boost_id'::text))::integer) AND ((s.widget_id)::text = (b.value ->> 'widget_id'::text)))
3. 758.799 758.799 ↑ 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.014..758.799 rows=6,000,479 loops=1)

4. 0.509 50.562 ↓ 0.0 0 1

Hash (cost=4,122.45..4,122.45 rows=1 width=89) (actual time=50.562..50.562 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
5. 6.474 50.053 ↓ 1,497.0 1,497 1

Hash Join (cost=2,932.52..4,122.45 rows=1 width=89) (actual time=33.393..50.053 rows=1,497 loops=1)

  • Hash Cond: (((block_history.key)::text = (b.key)::text) AND ((max(block_history.seq)) = b.seq))
6. 25.999 29.826 ↑ 1.0 41,764 1

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

  • Group Key: block_history.key
7. 3.827 3.827 ↑ 1.1 44,254 1

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

8. 0.857 13.753 ↓ 9.1 2,126 1

Hash (cost=1,464.51..1,464.51 rows=234 width=93) (actual time=13.753..13.753 rows=2,126 loops=1)

  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 297kB
9. 12.896 12.896 ↓ 9.1 2,126 1

Seq Scan on block_history b (cost=0.00..1,464.51 rows=234 width=93) (actual time=0.103..12.896 rows=2,126 loops=1)

  • Filter: ((value ->> 'blocked'::text) = 'false'::text)
  • Rows Removed by Filter: 42128
Planning time : 0.388 ms
Execution time : 6,324.188 ms