explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hsrD

Settings
# exclusive inclusive rows x rows loops node
1. 9.368 149.862 ↓ 6,818.0 6,818 1

Sort (cost=193.80..193.81 rows=1 width=360) (actual time=147.655..149.862 rows=6,818 loops=1)

  • Sort Key: full_flights.price_adult
  • Sort Method: quicksort Memory: 3,694kB
2. 25.619 140.494 ↓ 6,818.0 6,818 1

Hash Join (cost=117.05..193.79 rows=1 width=360) (actual time=96.326..140.494 rows=6,818 loops=1)

  • Hash Cond: ((full_flights.outbound_flight_key = full_flights_1.outbound_flight_key) AND (full_flights.inbound_flight_key = full_flights_1.inbound_flight_key) AND (full_flights.updated_at = (max(full_flights_1.updated_at))))
3. 23.916 35.635 ↓ 1,700.9 32,318 1

Bitmap Heap Scan on full_flights (cost=20.16..96.68 rows=19 width=360) (actual time=13.836..35.635 rows=32,318 loops=1)

  • Recheck Cond: (((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-23'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-24'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-25'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-26'::text) AND (inbound_arrival_airport = 'DUS'::text)))
  • Heap Blocks: exact=12,819
4. 0.002 11.719 ↓ 0.0 0 1

BitmapOr (cost=20.16..20.16 rows=19 width=0) (actual time=11.719..11.719 rows=0 loops=1)

5. 3.648 3.648 ↓ 2,041.2 10,206 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=3.648..3.648 rows=10,206 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-23'::text) AND (inbound_arrival_airport = 'DUS'::text))
6. 2.520 2.520 ↓ 1,321.8 6,609 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=2.520..2.520 rows=6,609 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-24'::text) AND (inbound_arrival_airport = 'DUS'::text))
7. 3.102 3.102 ↓ 1,696.4 8,482 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=3.102..3.102 rows=8,482 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-25'::text) AND (inbound_arrival_airport = 'DUS'::text))
8. 2.447 2.447 ↓ 1,404.2 7,021 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=2.447..2.447 rows=7,021 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-26'::text) AND (inbound_arrival_airport = 'DUS'::text))
9. 3.597 79.240 ↓ 2,718.0 5,436 1

Hash (cost=96.86..96.86 rows=2 width=193) (actual time=79.240..79.240 rows=5,436 loops=1)

  • Buckets: 8,192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 1,232kB
10. 39.906 75.643 ↓ 2,718.0 5,436 1

HashAggregate (cost=96.82..96.84 rows=2 width=187) (actual time=73.157..75.643 rows=5,436 loops=1)

  • Group Key: full_flights_1.outbound_flight_key, full_flights_1.inbound_flight_key
11. 24.004 35.737 ↓ 1,700.9 32,318 1

Bitmap Heap Scan on full_flights full_flights_1 (cost=20.16..96.68 rows=19 width=187) (actual time=13.822..35.737 rows=32,318 loops=1)

  • Recheck Cond: (((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-23'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-24'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-25'::text) AND (inbound_arrival_airport = 'DUS'::text)) OR ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-26'::text) AND (inbound_arrival_airport = 'DUS'::text)))
  • Heap Blocks: exact=12,819
12. 0.002 11.733 ↓ 0.0 0 1

BitmapOr (cost=20.16..20.16 rows=19 width=0) (actual time=11.733..11.733 rows=0 loops=1)

13. 3.736 3.736 ↓ 2,041.2 10,206 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=3.736..3.736 rows=10,206 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-23'::text) AND (inbound_arrival_airport = 'DUS'::text))
14. 2.485 2.485 ↓ 1,321.8 6,609 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=2.485..2.485 rows=6,609 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-24'::text) AND (inbound_arrival_airport = 'DUS'::text))
15. 3.083 3.083 ↓ 1,696.4 8,482 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=3.083..3.083 rows=8,482 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-25'::text) AND (inbound_arrival_airport = 'DUS'::text))
16. 2.427 2.427 ↓ 1,404.2 7,021 1

Bitmap Index Scan on full_flights_big_index (cost=0.00..5.04 rows=5 width=0) (actual time=2.427..2.427 rows=7,021 loops=1)

  • Index Cond: ((outbound_departure_airport = 'DUS'::text) AND (outbound_arrival_airport = 'MRU'::text) AND (inbound_departure_airport = 'MRU'::text) AND (inbound_departure_date = '2020-12-26'::text) AND (inbound_arrival_airport = 'DUS'::text))
Planning time : 0.976 ms
Execution time : 151.135 ms