explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BpqD

Settings
# exclusive inclusive rows x rows loops node
1. 4.540 1,096.008 ↑ 20.0 8 1

Unique (cost=669,913.76..676,139.65 rows=160 width=552) (actual time=1,087.725..1,096.008 rows=8 loops=1)

2. 27.582 1,091.468 ↑ 88.7 14,036 1

Sort (cost=669,913.76..673,026.70 rows=1,245,178 width=552) (actual time=1,087.723..1,091.468 rows=14,036 loops=1)

  • Sort Key: cruise_priceexamples_2000_1901160607.external_itinerary_id, (((((cruise_priceexamples_2000_1901160607.cruise_price + COALESCE(cruise_bedbanks_2000_1901160607.price, '0'::numeric)) + ('2'::numeric * COALESCE(fa.adult_price, '0'::numeric))) + ('0'::numeric * COALESCE(fa.child_price, '0'::numeric))))::integer)
  • Sort Method: quicksort Memory: 7622kB
3. 17.089 1,063.886 ↑ 88.7 14,036 1

Hash Left Join (cost=3,206.20..237,420.43 rows=1,245,178 width=552) (actual time=115.182..1,063.886 rows=14,036 loops=1)

  • Hash Cond: ((cruise_priceexamples_2000_1901160607.hotel_stay_ap_id = cruise_bedbanks_2000_1901160607.ap_id) AND (fa.bedbanks_arrival_date = cruise_bedbanks_2000_1901160607.arrival_date))
  • Join Filter: cruise_priceexamples_2000_1901160607.hotel_stay_needed
4. 447.793 971.123 ↑ 333.8 3,730 1

Hash Join (cost=388.96..203,469.55 rows=1,245,178 width=562) (actual time=39.473..971.123 rows=3,730 loops=1)

  • Hash Cond: ((fa.flight_group_key)::text = cruise_priceexamples_2000_1901160607.flight_group_key)
5. 522.686 522.686 ↓ 1.2 972,202 1

Seq Scan on flights_all fa (cost=0.00..126,977.52 rows=795,641 width=51) (actual time=0.009..522.686 rows=972,202 loops=1)

  • Filter: (seats >= 2)
  • Rows Removed by Filter: 1825
6. 0.312 0.644 ↓ 1.2 366 1

Hash (cost=385.05..385.05 rows=313 width=537) (actual time=0.644..0.644 rows=366 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 134kB
7. 0.259 0.332 ↓ 1.2 366 1

Bitmap Heap Scan on cruise_priceexamples_2000_1901160607 (cost=36.68..385.05 rows=313 width=537) (actual time=0.084..0.332 rows=366 loops=1)

  • Recheck Cond: (external_itinerary_id = ANY ('{MSC-U9Z8,MSC-U9Z9,MSC-U9ZA,MSC-U9ZM,MSC-U9ZN,MSC-UAMW,MSC-UAMX,MSC-UB3R}'::text[]))
  • Heap Blocks: exact=57
8. 0.073 0.073 ↓ 1.2 366 1

Bitmap Index Scan on ix_cruise_priceexamples_2000_1901160607_external_itinerary_id (cost=0.00..36.60 rows=313 width=0) (actual time=0.073..0.073 rows=366 loops=1)

  • Index Cond: (external_itinerary_id = ANY ('{MSC-U9Z8,MSC-U9Z9,MSC-U9ZA,MSC-U9ZM,MSC-U9ZN,MSC-UAMW,MSC-UAMX,MSC-UB3R}'::text[]))
9. 32.318 75.674 ↓ 3,946.4 86,820 1

Hash (cost=2,816.91..2,816.91 rows=22 width=50) (actual time=75.674..75.674 rows=86,820 loops=1)

  • Buckets: 131072 (originally 1024) Batches: 1 (originally 1) Memory Usage: 5775kB
10. 43.356 43.356 ↓ 3,946.4 86,820 1

Seq Scan on cruise_bedbanks_2000_1901160607 (cost=0.00..2,816.91 rows=22 width=50) (actual time=0.010..43.356 rows=86,820 loops=1)

  • Filter: ((price > '0'::numeric) AND (allotment > 0) AND (stay = 1))