explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fh1o

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 4,283.588 10,970.144 ↑ 1.0 6,000,479 1

Sort (cost=2,050,279.61..2,065,435.30 rows=6,062,275 width=127) (actual time=10,220.001..10,970.144 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: 340600kB
2. 5,753.709 6,686.556 ↑ 1.0 6,000,479 1

Hash Left Join (cost=4,122.47..186,239.05 rows=6,062,275 width=127) (actual time=46.340..6,686.556 rows=6,000,479 loops=1)

  • Hash Cond: (concat(s.ts_id, '-', s.widget_id) = (b.key)::text)
3. 886.551 886.551 ↑ 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.017..886.551 rows=6,000,479 loops=1)

4. 0.468 46.296 ↓ 1,497.0 1,497 1

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

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 194kB
5. 5.748 45.828 ↓ 1,497.0 1,497 1

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

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

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

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

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

8. 0.788 13.125 ↓ 9.1 2,126 1

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

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

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

  • Filter: ((value ->> 'blocked'::text) = 'false'::text)
  • Rows Removed by Filter: 42128
Planning time : 0.480 ms
Execution time : 11,165.784 ms