explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X9aD

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Unique (cost=1,780,800.21..1,780,800.21 rows=1 width=9) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=1,780,800.21..1,780,800.21 rows=1 width=9) (actual rows= loops=)

  • Sort Key: trip_flights.trip_id
3. 0.000 0.000 ↓ 0.0

Gather (cost=738,540.79..1,780,800.20 rows=1 width=9) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=737,540.79..1,779,800.10 rows=1 width=9) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=736,678.85..1,755,088.03 rows=12 width=55) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=736,678.28..1,685,775.61 rows=8,921 width=55) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on flight_keys fk (cost=736,677.71..836,971.68 rows=11,238 width=23) (actual rows= loops=)

  • Recheck Cond: ((departure_date >= '2019-12-15'::date) AND (departure_date <= '2019-12-15'::date) AND ((airline_code)::text = ANY ('{KL,AF,DL}'::text[])))
8. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=736,677.71..736,677.71 rows=26,971 width=0) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on flight_keys_departure_date_idx (cost=0.00..7,029.56 rows=293,699 width=0) (actual rows= loops=)

  • Index Cond: ((departure_date >= '2019-12-15'::date) AND (departure_date <= '2019-12-15'::date))
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on flight_keys_airline_code_idx (cost=0.00..729,634.41 rows=31,691,293 width=0) (actual rows= loops=)

  • Index Cond: ((airline_code)::text = ANY ('{KL,AF,DL}'::text[]))
11. 0.000 0.000 ↓ 0.0

Index Scan using trip_flights_composite_flight_key_id_idx on trip_flights (cost=0.57..75.31 rows=22 width=32) (actual rows= loops=)

  • Index Cond: ((composite_flight_key_id)::text = (fk.composite_flight_key_id)::text)
12. 0.000 0.000 ↓ 0.0

Index Scan using trips_pkey on trips t (cost=0.57..7.77 rows=1 width=9) (actual rows= loops=)

  • Index Cond: ((trip_id)::text = (trip_flights.trip_id)::text)
  • Filter: ((trip ->> 'accountId'::text) = '9987'::text)
13. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=861.94..2,059.33 rows=1 width=23) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using processed_flight_history_flight_key_composite_flight_key_id_idx on processed_flight_history_flight_keys (cost=0.57..7.76 rows=1 width=31) (actual rows= loops=)

  • Index Cond: ((composite_flight_key_id)::text = (trip_flights.composite_flight_key_id)::text)
15. 0.000 0.000 ↓ 0.0

Hash Join (cost=861.37..2,008.85 rows=4,272 width=8) (actual rows= loops=)

  • Hash Cond: ((pfk.arrival_airport_code)::text = (aa.airport_code)::text)
16. 0.000 0.000 ↓ 0.0

Hash Join (cost=431.25..1,487.94 rows=12,822 width=12) (actual rows= loops=)

  • Hash Cond: ((pfk.departure_airport_code)::text = (da.airport_code)::text)
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..785.27 rows=38,488 width=16) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Only Scan using processed_flight_history_flight_keys_pkey on processed_flight_history_flight_keys pfhfk (cost=0.57..5.91 rows=100 width=31) (actual rows= loops=)

  • Index Cond: (processed_flight_history_id = processed_flight_history_flight_keys.processed_flight_history_id)
19. 0.000 0.000 ↓ 0.0

Index Scan using flight_keys_pkey on flight_keys pfk (cost=0.57..7.79 rows=1 width=31) (actual rows= loops=)

  • Index Cond: ((composite_flight_key_id)::text = (pfhfk.composite_flight_key_id)::text)
  • Filter: ((departure_date >= '2019-12-15'::date) AND (departure_date <= '2019-12-17'::date) AND ((airline_code)::text = ANY ('{KL,AF,DL}'::text[])))
20. 0.000 0.000 ↓ 0.0

Hash (cost=361.11..361.11 rows=5,520 width=4) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on tmp_airports da (cost=0.00..361.11 rows=5,520 width=4) (actual rows= loops=)

  • Filter: ((is_active IS TRUE) AND ((country_code)::text = 'US'::text))
22. 0.000 0.000 ↓ 0.0

Hash (cost=361.11..361.11 rows=5,520 width=4) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on tmp_airports aa (cost=0.00..361.11 rows=5,520 width=4) (actual rows= loops=)

  • Filter: ((is_active IS TRUE) AND ((country_code)::text = 'US'::text))