explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ANb2 : Optimization for: Optimization for: plan #3PhT; plan #8OAB

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.086 21,956.270 ↑ 1.0 1 1

Index Scan using travel_cancellation_option_ma_partner_id_site_id_country_fa_idx on travel_cancellation_option_mapping tcom (cost=29,561.06..29,569.35 rows=1 width=99) (actual time=21,956.252..21,956.270 rows=1 loops=1)

  • Index Cond: ((partner_id = '1'::text) AND (site_id = '1'::text) AND (country = 'JP'::text) AND (fare_class = 'SuperValue'::text) AND (special_airport = $0) AND ((currency)::text = 'JPY'::text) AND (price_band_1_item_count = 1) AND (price_band_1_price_start < '20000'::numeric) AND (price_band_1_price_end >= '20000'::numeric) AND (price_band_2_item_count = 1) AND (price_band_2_price_start < '10000'::numeric) AND (price_band_2_price_end >= '10000'::numeric))
  • Filter: ((allowed_airports IS NULL) OR ('{HND,OSA}'::text[] <@ allowed_airports))
2.          

Initplan (forIndex Scan)

3. 0.036 21,956.184 ↑ 1.0 1 1

Aggregate (cost=29,560.63..29,560.64 rows=1 width=1) (actual time=21,956.168..21,956.184 rows=1 loops=1)

4. 10,989.312 21,956.148 ↓ 0.0 0 1

Hash Join (cost=0.05..29,558.53 rows=839 width=33) (actual time=21,956.140..21,956.148 rows=0 loops=1)

  • Hash Cond: (sa.code = "*VALUES*".column1)
  • Join Filter: ((sa.start_day <= "*VALUES*".column2) AND (sa.start_month <= "*VALUES*".column3) AND (sa.end_day >= "*VALUES*".column2) AND (sa.end_month >= "*VALUES*".column3))
5. 10,966.750 10,966.750 ↑ 1.0 883,116 1

Seq Scan on special_airports sa (cost=0.00..24,888.16 rows=883,116 width=53) (actual time=0.063..10,966.750 rows=883,116 loops=1)

6. 0.044 0.086 ↑ 1.0 2 1

Hash (cost=0.03..0.03 rows=2 width=40) (actual time=0.077..0.086 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.042 0.042 ↑ 1.0 2 1

Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=40) (actual time=0.013..0.042 rows=2 loops=1)