explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VN36 : Optimization for: Optimization for: plan #jeQP; plan #hEXz

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5.532 25.524 ↓ 204.0 204 1

Seq Scan on travel_cancellation_option_mapping tcom (cost=0.00..20,850.56 rows=1 width=99) (actual time=5.046..25.524 rows=204 loops=1)

  • Filter: ((NOT is_deleted) AND ((allowed_airports IS NULL) OR ('{NRT,OKA}'::text[] <@ allowed_airports)) AND (partner_id = '1'::text) AND (site_id = '1'::text) AND (country = 'JP'::text) AND ((currency)::text = 'JPY'::text) AND ((fare_class = 'SV21A'::text) OR (fare_class = (SubPlan 1))) AND ((SubPlan 2) = special_airport))
  • Rows Removed by Filter: 612
2.          

SubPlan (forSeq Scan)

3. 9.792 9.792 ↓ 0.0 0 816

Index Scan using fare_class_aliases_alias_idx on fare_class_aliases (cost=0.41..8.43 rows=1 width=9) (actual time=0.011..0.012 rows=0 loops=816)

  • Index Cond: ((mapping_id = tcom.id) AND (alias = 'SV21A'::text))
  • Filter: (NOT is_deleted)
4. 1.224 10.200 ↑ 1.0 1 408

Aggregate (cost=16.93..16.95 rows=1 width=1) (actual time=0.024..0.025 rows=1 loops=408)

5. 0.816 8.976 ↑ 1.0 1 408

Nested Loop (cost=0.41..16.93 rows=1 width=33) (actual time=0.022..0.022 rows=1 loops=408)

6. 0.816 0.816 ↑ 1.0 2 408

Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=40) (actual time=0.001..0.002 rows=2 loops=408)

7. 7.344 7.344 ↓ 0.0 0 816

Index Scan using special_airports_mapping_id_code_start_day_start_month_end__idx on special_airports sa (cost=0.41..8.44 rows=1 width=53) (actual time=0.009..0.009 rows=0 loops=816)

  • Index Cond: ((tcom.id = mapping_id) AND (code = "*VALUES*".column1) AND (start_day <= "*VALUES*".column2) AND (start_month <= "*VALUES*".column3) AND (end_day >= "*VALUES*".column2) AND (end_month >= "*VALUES*".column3))