explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BktC : Optimization for: Optimization for: Optimization for: Optimization for: plan #jyov; plan #Yj9t; plan #vrTD; plan #iVmn

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.047 2,462.816 ↑ 1.0 1 1

Unique (cost=18,733.20..18,733.21 rows=1 width=99) (actual time=2,462.761..2,462.816 rows=1 loops=1)

2.          

CTE candidates

3. 901.387 1,676.002 ↓ 1.7 22,644 1

HashAggregate (cost=18,238.96..18,373.04 rows=13,408 width=33) (actual time=1,403.959..1,676.002 rows=22,644 loops=1)

  • Group Key: sa.mapping_id
4. 736.924 774.615 ↓ 2.3 45,288 1

Bitmap Heap Scan on special_airports sa (cost=992.64..18,188.86 rows=20,038 width=33) (actual time=42.507..774.615 rows=45,288 loops=1)

  • Recheck Cond: (('KTD'::text = code) OR ('OKA'::text = code))
  • Filter: ((1 >= start_day) AND (1 <= end_day) AND (9 >= start_month) AND (9 <= end_month))
  • Heap Blocks: exact=16057
5. 0.438 37.691 ↓ 0.0 0 1

BitmapOr (cost=992.64..992.64 rows=45,569 width=0) (actual time=37.269..37.691 rows=0 loops=1)

6. 30.506 30.506 ↑ 1.0 22,644 1

Bitmap Index Scan on special_airports_codes (cost=0.00..491.97 rows=22,873 width=0) (actual time=30.494..30.506 rows=22,644 loops=1)

  • Index Cond: ('KTD'::text = code)
7. 6.747 6.747 ↑ 1.0 22,644 1

Bitmap Index Scan on special_airports_codes (cost=0.00..490.65 rows=22,696 width=0) (actual time=6.735..6.747 rows=22,644 loops=1)

  • Index Cond: ('OKA'::text = code)
8. 0.127 2,462.769 ↑ 1.0 1 1

Sort (cost=360.16..360.16 rows=1 width=99) (actual time=2,462.734..2,462.769 rows=1 loops=1)

  • Sort Key: tcom.product_group_option_id, tcom.price_band_1_product_group_option_id, tcom.price_band_2_product_group_option_id
  • Sort Method: quicksort Memory: 25kB
9. 251.187 2,462.642 ↑ 1.0 1 1

Hash Join (cost=41.70..360.15 rows=1 width=99) (actual time=2,017.500..2,462.642 rows=1 loops=1)

  • Hash Cond: (candidates.mapping_id = tcom.id)
10. 2,211.134 2,211.134 ↓ 1.7 22,644 1

CTE Scan on candidates (cost=0.00..268.16 rows=13,408 width=32) (actual time=1,403.985..2,211.134 rows=22,644 loops=1)

11. 0.040 0.321 ↓ 2.0 2 1

Hash (cost=41.69..41.69 rows=1 width=132) (actual time=0.307..0.321 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.281 0.281 ↓ 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..41.69 rows=1 width=132) (actual time=0.105..0.281 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_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))