explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AGX

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 0.361 ↓ 0.0 0 1

Limit (cost=102.25..102.26 rows=2 width=559) (actual time=0.360..0.361 rows=0 loops=1)

2. 0.009 0.359 ↓ 0.0 0 1

Sort (cost=102.25..102.26 rows=2 width=559) (actual time=0.358..0.359 rows=0 loops=1)

  • Sort Key: ((t2.location <-> '0101000020E6100000A9F57EA31D5747C0C4CE143AAF9537C0'::geometry)), t2.score DESC, t2.merchant_short_id
  • Sort Method: quicksort Memory: 25kB
3. 0.002 0.350 ↓ 0.0 0 1

Subquery Scan on t2 (cost=100.77..102.24 rows=2 width=559) (actual time=0.349..0.350 rows=0 loops=1)

  • Filter: (t2.group_rn <= 1)
4. 0.004 0.348 ↓ 0.0 0 1

WindowAgg (cost=100.77..101.62 rows=6 width=500) (actual time=0.347..0.348 rows=0 loops=1)

5. 0.010 0.344 ↓ 0.0 0 1

Sort (cost=100.77..100.78 rows=6 width=616) (actual time=0.344..0.344 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.002 0.334 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.26..100.69 rows=6 width=616) (actual time=0.333..0.334 rows=0 loops=1)

7. 0.004 0.332 ↓ 0.0 0 1

Nested Loop (cost=0.98..75.39 rows=6 width=538) (actual time=0.332..0.332 rows=0 loops=1)

8. 0.088 0.123 ↑ 6.0 1 1

Nested Loop Left Join (cost=0.72..73.92 rows=6 width=506) (actual time=0.097..0.123 rows=1 loops=1)

  • Filter: COALESCE((true), false)
  • -> Index Only Scan using merchant_shifts_merchant_short_id_dow_shift_range_excl on merchant_shifts shift (cost=0.43..2.73 rows=1 width=31) (actual time=0.059
9. 0.035 0.035 ↑ 11.0 1 1

Index Scan using idx_merchant_test1 on merchants merc (cost=0.29..42.80 rows=11 width=519) (actual time=0.021..0.035 rows=1 loops=1)

  • Index Cond: ((supports_takeout = true) AND (supports_delivery = false))
  • Filter: (supports_takeout AND (NOT supports_delivery) AND (NOT supports_dark_kitchen) AND available AND (COALESCE(connected, false) OR always_online) AND
  • Rows Removed by Filter: 4
  • Index Cond: ((merchant_short_id = merc.merchant_short_id) AND (dow = (date_part('dow'::text, timezone((merc.timezone)::text, now())))::integer) AND (shif
  • Heap Fetches: 1
10. 0.205 0.205 ↓ 0.0 0 1

Function Scan on round d (cost=0.26..0.36 rows=1 width=32) (actual time=0.205..0.205 rows=0 loops=1)

  • Filter: (distance <= 15.0)
  • Rows Removed by Filter: 1
11. 0.000 0.000 ↓ 0.0 0

Index Scan using chain_external_id_key on merchant_chain chain (cost=0.28..4.21 rows=1 width=82) (never executed)

  • Index Cond: ((merc.group_id)::text = (external_id)::text)
Planning time : 1.633 ms
Execution time : 0.716 ms