explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qfNE

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 285.292 ↑ 1.3 74 1

Nested Loop Anti Join (cost=4,466.02..527,387.01 rows=94 width=2,274) (actual time=16.585..285.292 rows=74 loops=1)

2. 15.422 285.268 ↑ 2.5 74 1

Hash Join (cost=4,465.75..526,963.04 rows=188 width=2,254) (actual time=16.583..285.268 rows=74 loops=1)

  • Hash Cond: (a.program_id = p.program_id)
3. 18.672 267.247 ↓ 1.4 178,163 1

Nested Loop (cost=140.58..513,632.08 rows=130,966 width=941) (actual time=0.754..267.247 rows=178,163 loops=1)

4. 4.457 4.457 ↓ 1.7 106 1

Seq Scan on sentv_channel c (cost=0.00..1,173.59 rows=62 width=4) (actual time=0.168..4.457 rows=106 loops=1)

  • Filter: ((cardinality(region_dma_codes) > 0) AND (('SUPER'::text = ANY ('{EXTENDED,MACHINIMA,PREMIUM,EPIX,BASIC}'::text[])) OR ('{EXTENDED,MACHINIMA,PREMIUM,EPIX,BASIC}'::text[] && ent_keywords)) AND (((channel_id)::text || '_RESTRICTED'::text) <> ALL ('{EXTENDED,MACHINIMA,PREMIUM,EPIX,BASIC}'::text[])) AND (('NAT'::text = ANY (region_dma_codes)) OR ('NAT-EA'::text = ANY (region_dma_codes)) OR (('617'::text = ANY (region_dma_codes)) AND (('617'::text <> ALL (sub_dmas)) OR ('53081'::text = ANY (sub_dma_zips)) OR (sub_dmas = '{}'::text[]) OR (sub_dma_zips = '{}'::text[])))))
  • Rows Removed by Filter: 1071
5. 221.964 244.118 ↑ 1.3 1,681 106

Bitmap Heap Scan on sentv_airing a (cost=140.58..8,244.08 rows=2,138 width=945) (actual time=0.340..2.303 rows=1,681 loops=106)

  • Recheck Cond: (channel_id = c.channel_id)
  • Filter: (((age_rating || '_RESTRICTED'::text) <> ALL ('{EXTENDED,MACHINIMA,PREMIUM,EPIX,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: 6
  • Heap Blocks: exact=119810
6. 22.154 22.154 ↑ 1.4 1,730 106

Bitmap Index Scan on sentv_airing_channel_id_start_date_end_date_idx (cost=0.00..140.04 rows=2,495 width=0) (actual time=0.209..0.209 rows=1,730 loops=106)

  • Index Cond: (channel_id = c.channel_id)
7. 0.917 2.599 ↑ 1.0 1,089 1

Hash (cost=4,310.94..4,310.94 rows=1,138 width=1,317) (actual time=2.599..2.599 rows=1,089 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1043kB
8. 1.533 1.682 ↑ 1.0 1,089 1

Bitmap Heap Scan on sentv_program p (cost=37.24..4,310.94 rows=1,138 width=1,317) (actual time=0.263..1.682 rows=1,089 loops=1)

  • Recheck Cond: (season_id = '-21686'::integer)
  • Heap Blocks: exact=1068
9. 0.149 0.149 ↑ 1.0 1,102 1

Bitmap Index Scan on sentv_program_season_id_idx (cost=0.00..36.96 rows=1,138 width=0) (actual time=0.149..0.149 rows=1,102 loops=1)

  • Index Cond: (season_id = '-21686'::integer)
10. 0.000 0.000 ↓ 0.0 0 74

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

  • Index Cond: ((rule_name)::text = ANY (a.bo_rules))
  • Filter: CASE WHEN (('617'::text = ANY (dmas)) OR ('53081'::text = ANY (zipcodes)) OR ('roku'::text = ANY (device_types)) OR ((cardinality(media_blackouts) > 0) AND (('617_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