explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PEGt

Settings
# exclusive inclusive rows x rows loops node
1. 0.211 898.617 ↓ 1.1 506 1

Nested Loop Anti Join (cost=5,805.46..656,015.04 rows=449 width=2,322) (actual time=90.038..898.617 rows=506 loops=1)

2. 0.270 898.406 ↑ 1.8 506 1

Nested Loop (cost=5,805.19..654,000.89 rows=897 width=2,304) (actual time=90.035..898.406 rows=506 loops=1)

3. 81.355 894.088 ↑ 30.6 506 1

Hash Join (cost=5,804.90..647,273.46 rows=15,503 width=2,308) (actual time=90.007..894.088 rows=506 loops=1)

  • Hash Cond: (a.program_id = p.program_id)
4. 809.540 809.540 ↑ 2.3 877,976 1

Seq Scan on sentv_airing a (cost=0.00..633,795.92 rows=2,004,695 width=947) (actual time=0.091..809.540 rows=877,976 loops=1)

  • Filter: ((expiration_date >= now()) OR (dvr_expiration_date >= now()))
  • Rows Removed by Filter: 215363
5. 0.992 3.193 ↓ 1.0 1,663 1

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

  • Buckets: 2048 Batches: 1 Memory Usage: 1176kB
6. 1.971 2.201 ↓ 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.402..2.201 rows=1,663 loops=1)

  • Recheck Cond: (series_id = 70978)
  • Heap Blocks: exact=1489
7. 0.230 0.230 ↓ 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.230..0.230 rows=1,667 loops=1)

  • Index Cond: (series_id = 70978)
8. 4.048 4.048 ↑ 1.0 1 506

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

  • 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 506

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=506)

  • 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