explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cPv9 : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #vOOL; plan #AU1g; plan #v3gH; plan #D3Wj; plan #6huQ; plan #vXAm; plan #OMT8; plan #9qa; plan #S57s

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 0.438 ↑ 1.0 1 1

Subquery Scan on results (cost=76.67..76.70 rows=1 width=96) (actual time=0.438..0.438 rows=1 loops=1)

2. 0.096 0.437 ↑ 1.0 1 1

CTE Scan on candidates (cost=76.67..76.69 rows=1 width=98) (actual time=0.437..0.437 rows=1 loops=1)

  • Filter: ($5 = special_airport)
  • Rows Removed by Filter: 1
3.          

CTE candidates

4. 0.323 0.323 ↓ 2.0 2 1

Index Scan using travel_cancellation_option_ma_partner_id_site_id_country_fa_idx on travel_cancellation_option_mapping tcom (cost=0.41..59.40 rows=1 width=133) (actual time=0.087..0.323 rows=2 loops=1)

  • Index Cond: ((partner_id = '1'::text) AND (site_id = '1'::text) AND (country = 'JP'::text) AND (fare_class = 'SuperValue'::text) AND ((currency)::text = 'JPY'::text) AND (price_band_1_item_count = 1) AND (price_band_2_item_count = 1))
  • Filter: ((20000.0 <@ price_band_1_range) AND (10000.0 <@ price_band_2_range) AND ((allowed_airports IS NULL) OR ('{NRT,OKA}'::text[] <@ allowed_airports)))
  • Rows Removed by Filter: 10
5.          

Initplan (forCTE Scan)

6. 0.012 0.341 ↑ 1.0 1 1

Aggregate (cost=17.25..17.27 rows=1 width=1) (actual time=0.341..0.341 rows=1 loops=1)

7. 0.009 0.329 ↓ 2.0 2 1

Nested Loop (cost=0.55..17.25 rows=1 width=33) (actual time=0.057..0.329 rows=2 loops=1)

8. 0.240 0.240 ↓ 2.0 2 1

CTE Scan on candidates candidates_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.002..0.240 rows=2 loops=1)

9. 0.006 0.080 ↑ 2.0 1 2

Nested Loop (cost=0.55..17.21 rows=2 width=66) (actual time=0.040..0.040 rows=1 loops=2)

10. 0.010 0.010 ↑ 1.0 2 2

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

11. 0.064 0.064 ↓ 0.0 0 4

Index Scan using special_airports_mapping_id_code_start_day_start_month_end__idx on special_airports sa (cost=0.55..8.58 rows=1 width=86) (actual time=0.016..0.016 rows=0 loops=4)

  • Index Cond: ((mapping_id = candidates_1.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))
Planning time : 0.688 ms
Execution time : 0.619 ms