explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yd9k : PROD -> sem indice -> order by original

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 257.158 ↓ 0.0 0 1

Limit (cost=218,687.71..218,687.72 rows=1 width=887) (actual time=257.158..257.158 rows=0 loops=1)

2. 0.010 257.158 ↓ 0.0 0 1

Sort (cost=218,687.71..218,687.72 rows=1 width=887) (actual time=257.158..257.158 rows=0 loops=1)

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

Subquery Scan on t2 (cost=218,687.21..218,687.70 rows=1 width=887) (actual time=257.147..257.148 rows=0 loops=1)

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

WindowAgg (cost=218,687.21..218,687.50 rows=2 width=828) (actual time=257.147..257.147 rows=0 loops=1)

5. 0.006 257.145 ↓ 0.0 0 1

Sort (cost=218,687.21..218,687.22 rows=2 width=870) (actual time=257.145..257.145 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.000 257.139 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,000.99..218,687.20 rows=2 width=870) (actual time=257.139..257.139 rows=0 loops=1)

  • Filter: COALESCE((true), false)
7. 24.150 263.976 ↓ 0.0 0 1

Gather (cost=1,000.55..218,677.23 rows=3 width=878) (actual time=257.139..263.976 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 0.001 239.826 ↓ 0.0 0 3

Nested Loop Left Join (cost=0.55..217,676.93 rows=1 width=878) (actual time=239.826..239.826 rows=0 loops=3)

9. 0.003 239.825 ↓ 0.0 0 3

Nested Loop (cost=0.26..217,672.53 rows=1 width=768) (actual time=239.824..239.825 rows=0 loops=3)

10. 239.822 239.822 ↓ 0.0 0 3

Parallel Seq Scan on merchants merc (cost=0.00..217,672.07 rows=1 width=736) (actual time=239.822..239.822 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: 61987
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 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)
13. 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..3.22 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_range @> t
  • Heap Fetches: 0
Planning time : 0.810 ms
Execution time : 264.186 ms