explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nADG

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 449.313 ↓ 0.0 0 1

Limit (cost=213,122.71..213,122.71 rows=1 width=879) (actual time=449.313..449.313 rows=0 loops=1)

2. 0.006 449.312 ↓ 0.0 0 1

Sort (cost=213,122.71..213,122.71 rows=1 width=879) (actual time=449.312..449.312 rows=0 loops=1)

  • Sort Key: t2.distance, t2.score DESC, t2.merchant_short_id
  • Sort Method: quicksort Memory: 25kB
3. 0.000 449.306 ↓ 0.0 0 1

Subquery Scan on t2 (cost=213,122.45..213,122.70 rows=1 width=879) (actual time=449.306..449.306 rows=0 loops=1)

  • Filter: (t2.group_rn <= 1)
4. 0.002 449.306 ↓ 0.0 0 1

WindowAgg (cost=213,122.45..213,122.60 rows=1 width=828) (actual time=449.306..449.306 rows=0 loops=1)

5. 0.005 449.304 ↓ 0.0 0 1

Sort (cost=213,122.45..213,122.46 rows=1 width=870) (actual time=449.304..449.304 rows=0 loops=1)

  • Sort Key: merc.group_id, ((merc.available AND (COALESCE(merc.connected, false) OR merc.always_online) AND COALESCE((true), false))) DESC, merc.chain_priority DESC, d.distance, (
  • Sort Method: quicksort Memory: 25kB
6. 0.001 449.299 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,000.99..213,122.44 rows=1 width=870) (actual time=449.299..449.299 rows=0 loops=1)

7. 0.000 449.298 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,000.70..213,118.04 rows=1 width=759) (actual time=449.298..449.298 rows=0 loops=1)

  • Filter: COALESCE((true), false)
8. 31.237 457.027 ↓ 0.0 0 1

Gather (cost=1,000.26..213,108.73 rows=2 width=768) (actual time=449.298..457.027 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
9. 0.004 425.790 ↓ 0.0 0 3

Nested Loop (cost=0.26..212,108.53 rows=1 width=768) (actual time=425.790..425.790 rows=0 loops=3)

10. 425.786 425.786 ↓ 0.0 0 3

Parallel Seq Scan on merchants merc (cost=0.00..212,108.07 rows=1 width=736) (actual time=425.786..425.786 rows=0 loops=3)

  • Filter: (supports_takeout AND (NOT supports_delivery) AND (NOT supports_dark_kitchen) AND available AND (COALESCE(connected, false) OR always_onlin
  • Rows Removed by Filter: 61838
11. 0.000 0.000 ↓ 0.0 0

Function Scan on round d (cost=0.26..0.36 rows=1 width=32) (never executed)

  • Filter: (distance <= 15.0)
12. 0.000 0.000 ↓ 0.0 0

Index Only Scan using merchant_shifts_merchant_short_id_dow_shift_range_excl on merchant_shifts shift (cost=0.44..4.55 rows=1 width=31) (never executed)

  • Index Cond: ((merchant_short_id = merc.merchant_short_id) AND (dow = (date_part('dow'::text, timezone((merc.timezone)::text, now())))::integer) AND (shift_rang
  • Heap Fetches: 0
13. 0.000 0.000 ↓ 0.0 0

Index Scan using chain_external_id_key on merchant_chain chain (cost=0.29..4.39 rows=1 width=115) (never executed)

  • Index Cond: ((merc.group_id)::text = (external_id)::text)