explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tf7X

Settings
# exclusive inclusive rows x rows loops node
1. 146.960 6,869.629 ↑ 4.1 429,214 1

Unique (cost=1,764,284.01..1,781,669.02 rows=1,738,501 width=1,673) (actual time=5,847.397..6,869.629 rows=429,214 loops=1)

2. 4,350.700 6,722.669 ↑ 4.0 437,975 1

Sort (cost=1,764,284.01..1,768,630.26 rows=1,738,501 width=1,673) (actual time=5,847.395..6,722.669 rows=437,975 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))) + ('4'::numeric * COALESCE(fa.child_price, '0'::numeric))))::integer ELSE ((p.price_current + (1 * COALESCE(fa.adult_markup, 0))) + (4 * COALESCE(fa.child_markup, 0))) END)
  • Sort Method: external merge Disk: 286280kB
3. 1,536.036 2,371.969 ↑ 4.0 437,975 1

Hash Join (cost=62,642.86..318,416.49 rows=1,738,501 width=1,673) (actual time=751.615..2,371.969 rows=437,975 loops=1)

  • Hash Cond: (p.flight_group_key = fa.flight_group_key)
4. 84.486 84.486 ↑ 1.0 671,236 1

Seq Scan on prices_1040 p (cost=0.00..58,346.36 rows=671,236 width=969) (actual time=0.004..84.486 rows=671,236 loops=1)

5. 271.620 751.447 ↓ 879.6 455,651 1

Hash (cost=62,636.38..62,636.38 rows=518 width=1,180) (actual time=751.447..751.447 rows=455,651 loops=1)

  • Buckets: 131072 (originally 1024) Batches: 8 (originally 1) Memory Usage: 38977kB
6. 0.000 479.827 ↓ 879.6 455,651 1

Gather (cost=1,000.00..62,636.38 rows=518 width=1,180) (actual time=18.997..479.827 rows=455,651 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 517.802 517.802 ↓ 703.2 151,884 3

Parallel Seq Scan on flights_all fa (cost=0.00..61,584.58 rows=216 width=1,180) (actual time=16.635..517.802 rows=151,884 loops=3)

  • Filter: (d3pf AND (seats >= 5) AND (stay = (bedbanks_nights + 1)))
  • Rows Removed by Filter: 54985
Planning time : 4.019 ms