explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HBKE

Settings
# exclusive inclusive rows x rows loops node
1. 52,749.280 1,187,784.290 ↑ 1.0 58,110,390 1

Merge Right Join (cost=45,365,666.38..46,962,594.34 rows=59,505,494 width=223) (actual time=924,493.181..1,187,784.290 rows=58,110,390 loops=1)

  • Merge Cond: ((d_1.program_rank_id = d.program_rank_id) AND (am.audience_sk = audience_map_1.audience_sk))
2. 80,821.390 130,425.562 ↓ 1.0 54,782,130 1

Sort (cost=14,250,036.65..14,386,967.60 rows=54,772,380 width=44) (actual time=114,648.804..130,425.562 rows=54,782,130 loops=1)

  • Sort Key: d_1.program_rank_id, am.audience_sk
  • Sort Method: external sort Disk: 1597872kB
3. 21,481.955 49,604.172 ↓ 1.0 54,782,130 1

Hash Join (cost=50.70..2,155,204.79 rows=54,772,380 width=44) (actual time=1.096..49,604.172 rows=54,782,130 loops=1)

  • Hash Cond: ("*VALUES*_1".column1 = (am.audience_genesis_name)::text)
4. 11,864.681 28,121.154 ↓ 1.0 54,782,130 1

Nested Loop (cost=0.00..1,402,033.86 rows=54,772,380 width=72) (actual time=0.024..28,121.154 rows=54,782,130 loops=1)

5. 1,086.037 1,086.037 ↓ 1.0 280,934 1

Seq Scan on demo_groups d_1 (cost=0.00..169,655.31 rows=280,884 width=1,117) (actual time=0.012..1,086.037 rows=280,934 loops=1)

  • Filter: ((rate_card_type_code)::text = 'acm3'::text)
  • Rows Removed by Filter: 578936
6. 15,170.436 15,170.436 ↑ 1.0 195 280,934

Values Scan on "*VALUES*_1" (cost=0.00..2.44 rows=195 width=64) (actual time=0.000..0.054 rows=195 loops=280,934)

7. 0.045 1.063 ↑ 1.0 195 1

Hash (cost=48.26..48.26 rows=195 width=22) (actual time=1.063..1.063 rows=195 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
8. 0.058 1.018 ↑ 1.0 195 1

Subquery Scan on am (cost=44.36..48.26 rows=195 width=22) (actual time=0.925..1.018 rows=195 loops=1)

9. 0.713 0.960 ↑ 1.0 195 1

HashAggregate (cost=44.36..46.31 rows=195 width=28) (actual time=0.923..0.960 rows=195 loops=1)

  • Group Key: audience_map.audience_sk, audience_map.audience, audience_map.audience_genesis_name
10. 0.247 0.247 ↑ 1.0 1,392 1

Seq Scan on audience_map (cost=0.00..33.92 rows=1,392 width=28) (actual time=0.014..0.247 rows=1,392 loops=1)

11. 11,492.995 1,004,609.448 ↓ 1.0 58,110,390 1

Materialize (cost=31,115,629.73..31,405,207.66 rows=57,915,585 width=191) (actual time=809,844.353..1,004,609.448 rows=58,110,390 loops=1)

12. 935,728.213 993,116.453 ↓ 1.0 58,110,390 1

Sort (cost=31,115,629.73..31,260,418.70 rows=57,915,585 width=191) (actual time=809,824.054..993,116.453 rows=58,110,390 loops=1)

  • Sort Key: d.program_rank_id, audience_map_1.audience_sk
  • Sort Method: external merge Disk: 9479016kB
13. 25,428.684 57,388.240 ↓ 1.0 58,110,390 1

Hash Join (cost=50.70..2,269,145.97 rows=57,915,585 width=191) (actual time=1.040..57,388.240 rows=58,110,390 loops=1)

  • Hash Cond: ("*VALUES*".column1 = (audience_map_1.audience_genesis_name)::text)
14. 14,766.226 31,958.573 ↓ 1.0 58,110,390 1

Nested Loop (cost=0.00..1,472,755.98 rows=57,915,585 width=181) (actual time=0.045..31,958.573 rows=58,110,390 loops=1)

15. 1,100.239 1,100.239 ↓ 1.0 298,002 1

Seq Scan on demo_groups d (cost=0.00..169,655.31 rows=297,003 width=1,226) (actual time=0.016..1,100.239 rows=298,002 loops=1)

  • Filter: ((rate_card_type_code)::text = 'std'::text)
  • Rows Removed by Filter: 561868
16. 16,092.108 16,092.108 ↑ 1.0 195 298,002

Values Scan on "*VALUES*" (cost=0.00..2.44 rows=195 width=64) (actual time=0.000..0.054 rows=195 loops=298,002)

17. 0.054 0.983 ↑ 1.0 195 1

Hash (cost=48.26..48.26 rows=195 width=28) (actual time=0.983..0.983 rows=195 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
18. 0.703 0.929 ↑ 1.0 195 1

HashAggregate (cost=44.36..46.31 rows=195 width=28) (actual time=0.897..0.929 rows=195 loops=1)

  • Group Key: audience_map_1.audience_sk, audience_map_1.audience, audience_map_1.audience_genesis_name
19. 0.226 0.226 ↑ 1.0 1,392 1

Seq Scan on audience_map audience_map_1 (cost=0.00..33.92 rows=1,392 width=28) (actual time=0.006..0.226 rows=1,392 loops=1)