explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3DJ3

Settings
# exclusive inclusive rows x rows loops node
1. 3,146.915 65,713.210 ↓ 48.7 4,872,562 1

Unique (cost=431,924.00..432,923.57 rows=99,957 width=490) (actual time=61,348.234..65,713.210 rows=4,872,562 loops=1)

2. 55,308.590 62,566.295 ↓ 50.3 5,026,200 1

Sort (cost=431,924.00..432,173.89 rows=99,957 width=490) (actual time=61,348.231..62,566.295 rows=5,026,200 loops=1)

  • Sort Key: fa.dynamic_flight_group_key, p.ap_id, p.room_group, (CASE WHEN (fa.markup_type = 'PREMIUM'::text) THEN ((((p.price_current)::numeric + ('1'::numeric * COALESCE(fa.adult_price, '0'::numeric))) + ('0'::numeric * COALESCE(fa.child_price, '0'::numeric))))::integer ELSE ((p.price_current + (1 * COALESCE(fa.adult_markup, 0))) + (0 * COALESCE(fa.child_markup, 0))) END)
  • Sort Method: quicksort Memory: 5246647kB
3. 0.000 7,257.705 ↓ 50.3 5,026,200 1

Gather (cost=1,000.56..423,623.06 rows=99,957 width=490) (actual time=4.842..7,257.705 rows=5,026,200 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 8,554.643 8,690.469 ↓ 40.2 1,675,400 3

Nested Loop (cost=0.56..408,108.49 rows=41,649 width=490) (actual time=1.443..8,690.469 rows=1,675,400 loops=3)

5. 135.809 135.809 ↓ 155.1 197,486 3

Parallel Seq Scan on flights_all_test fa (cost=0.00..61,770.30 rows=1,273 width=330) (actual time=1.379..135.809 rows=197,486 loops=3)

  • Filter: (d3pf AND (seats >= 1) AND (stay = (bedbanks_nights + 1)))
  • Rows Removed by Filter: 10208
6. 0.017 0.017 ↑ 10.5 8 592,457

Index Scan using ix_prices_test2 on prices_1000_test p (cost=0.56..268.69 rows=84 width=278) (actual time=0.011..0.017 rows=8 loops=592,457)

  • Index Cond: (flight_group_key = fa.flight_group_key)