explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

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

Sort (cost=1,551,441.73..1,566,597.42 rows=6,062,275 width=95) (actual time=5,407.222..6,195.030 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,110.927 2,922.488 ↑ 1.0 6,000,479 1

Hash Left Join (cost=4,124.23..246,862.17 rows=6,062,275 width=95) (actual time=54.679..2,922.488 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)))
3. 756.941 756.941 ↑ 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.039..756.941 rows=6,000,479 loops=1)

4. 1.131 54.620 ↓ 1,012.0 1,012 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 138kB
5. 6.071 53.489 ↓ 1,497.0 1,497 1

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

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

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

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

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

8. 0.919 17.904 ↓ 9.1 2,126 1

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

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

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

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