explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wcv8

Settings
# exclusive inclusive rows x rows loops node
1. 0.292 1,086.394 ↓ 1.5 592 1

Nested Loop Anti Join (cost=5,805.46..678,769.11 rows=389 width=2,322) (actual time=100.561..1,086.394 rows=592 loops=1)

2. 0.023 1,086.102 ↑ 1.3 592 1

Nested Loop (cost=5,805.19..677,022.97 rows=778 width=2,304) (actual time=100.558..1,086.102 rows=592 loops=1)

3. 101.076 1,080.751 ↑ 22.7 592 1

Hash Join (cost=5,804.90..671,134.17 rows=13,445 width=2,308) (actual time=100.532..1,080.751 rows=592 loops=1)

  • Hash Cond: (a.program_id = p.program_id)
4. 976.443 976.443 ↑ 1.6 1,078,327 1

Seq Scan on sentv_airing a (cost=0.00..658,675.25 rows=1,738,552 width=947) (actual time=0.110..976.443 rows=1,078,327 loops=1)

  • Filter: (((age_rating || '_RESTRICTED'::text) <> ALL ('{SUPER,EXTENDED,PREMIUM,ULTRA,BASIC}'::text[])) AND ((type <> 'vod'::text) OR (((vod_ready_date IS NULL) OR (vod_ready_date <= now())) AND (expiration_date >= now()))))
  • Rows Removed by Filter: 15012
5. 1.027 3.232 ↓ 1.0 1,663 1

Hash (cost=5,784.33..5,784.33 rows=1,646 width=1,365) (actual time=3.232..3.232 rows=1,663 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1176kB
6. 1.969 2.205 ↓ 1.0 1,663 1

Bitmap Heap Scan on sentv_program p (cost=109.18..5,784.33 rows=1,646 width=1,365) (actual time=0.411..2.205 rows=1,663 loops=1)

  • Recheck Cond: (series_id = 70978)
  • Heap Blocks: exact=1489
7. 0.236 0.236 ↓ 1.0 1,667 1

Bitmap Index Scan on sentv_program_series_id_idx (cost=0.00..108.77 rows=1,646 width=0) (actual time=0.236..0.236 rows=1,667 loops=1)

  • Index Cond: (series_id = 70978)
8. 5.328 5.328 ↑ 1.0 1 592

Index Scan using sentv_channel_channel_id_idx on sentv_channel c (cost=0.29..0.43 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=592)

  • Index Cond: (channel_id = a.channel_id)
  • Filter: ((cardinality(region_dma_codes) > 0) AND (('SUPER'::text = ANY ('{SUPER,EXTENDED,PREMIUM,ULTRA,BASIC}'::text[])) OR ('{SUPER,EXTENDED,PREMIUM,ULTRA,BASIC}'::text[] && ent_keywords)) AND (((channel_id)::text || '_RESTRICTED'::text) <> ALL ('{SUPER,EXTENDED,PREMIUM,ULTRA,BASIC}'::text[])) AND (('NAT'::text = ANY (region_dma_codes)) OR ('NAT-EA'::text = ANY (region_dma_codes)) OR (('501'::text = ANY (region_dma_codes)) AND (('501'::text <> ALL (sub_dmas)) OR ('10543'::text = ANY (sub_dma_zips)) OR (sub_dmas = '{}'::text[]) OR (sub_dma_zips = '{}'::text[])))))
9. 0.000 0.000 ↓ 0.0 0 592

Index Scan using sentv_blackout_rule_pkey on sentv_blackout_rule b (cost=0.28..3.55 rows=5 width=1,425) (actual time=0.000..0.000 rows=0 loops=592)

  • Index Cond: ((rule_name)::text = ANY (a.bo_rules))
  • Filter: CASE WHEN (('501'::text = ANY (dmas)) OR ('10543'::text = ANY (zipcodes)) OR ('ps4'::text = ANY (device_types)) OR ((cardinality(media_blackouts) > 0) AND (('501_BLACKOUT'::text = ANY (a.bo_keywords)) OR (a.bo_keywords && media_blackouts)))) THEN CASE WHEN (rule_type = 1) THEN true ELSE false END ELSE CASE WHEN (rule_type = 2) THEN true ELSE false END END