explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NrFT

Settings
# exclusive inclusive rows x rows loops node
1. 0.147 40.867 ↓ 1.1 130 1

Sort (cost=5,688.56..5,688.85 rows=117 width=879) (actual time=40.862..40.867 rows=130 loops=1)

  • Sort Key: t2.distance, t2.score DESC, t2.merchant_short_id
  • Sort Method: quicksort Memory: 198kB
2. 0.031 40.720 ↓ 1.1 130 1

Subquery Scan on t2 (cost=5,598.79..5,684.54 rows=117 width=879) (actual time=40.481..40.720 rows=130 loops=1)

  • Filter: (t2.group_rn <= 1)
  • Rows Removed by Filter: 93
3. 0.206 40.689 ↑ 1.6 223 1

WindowAgg (cost=5,598.79..5,648.66 rows=350 width=828) (actual time=40.479..40.689 rows=223 loops=1)

4. 0.554 40.483 ↑ 1.6 223 1

Sort (cost=5,598.79..5,599.66 rows=350 width=869) (actual time=40.471..40.483 rows=223 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, (((merc
  • Sort Method: quicksort Memory: 366kB
5. 0.439 39.929 ↑ 1.6 223 1

Nested Loop Left Join (cost=1.41..5,584.00 rows=350 width=869) (actual time=1.074..39.929 rows=223 loops=1)

6. 0.000 38.821 ↑ 1.6 223 1

Nested Loop (cost=1.12..5,037.12 rows=350 width=758) (actual time=1.064..38.821 rows=223 loops=1)

7. 35.094 35.094 ↓ 2.7 960 1

Nested Loop Left Join (cost=0.86..4,965.99 rows=350 width=726) (actual time=0.074..35.094 rows=960 loops=1)

  • Filter: COALESCE((true), false)
  • Rows Removed by Filter: 177
  • -> Index Scan using search_platform_merchants_suptak_supdel_index on merchants merc (cost=0.42..2779.24 rows=700 width=735) (actual time=0.038..3.339 rows=1137 loo
  • Index Cond: (supports_takeout = true)
  • Filter: (supports_takeout AND available AND (COALESCE(connected, false) OR always_online) AND (channels && '{IFOOD}'::text[]))
  • Rows Removed by Filter: 559
  • -> Index Only Scan using merchant_shifts_merchant_short_id_dow_shift_range_excl on merchant_shifts shift (cost=0.44..3.02 rows=1 width=31) (actual time=0.021..0.02
  • 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: 681
8. 3.840 3.840 ↓ 0.0 0 960

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

  • Filter: (distance <= 15.0)
  • Rows Removed by Filter: 1
9. 0.669 0.669 ↑ 1.0 1 223

Index Scan using chain_external_id_key on merchant_chain chain (cost=0.29..1.56 rows=1 width=115) (actual time=0.003..0.003 rows=1 loops=223)

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