explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZPXF

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 1.913 ↑ 1.0 1 1

Aggregate (cost=2,251.55..2,251.65 rows=1 width=16) (actual time=1.912..1.913 rows=1 loops=1)

  • Buffers: shared hit=549
2.          

Initplan (forAggregate)

3. 0.003 1.876 ↑ 1.0 1 1

Aggregate (cost=1,869.05..1,869.15 rows=1 width=8) (actual time=1.875..1.876 rows=1 loops=1)

  • Buffers: shared hit=548
4. 1.873 1.873 ↓ 0.0 0 1

Index Scan using idx_merchant_test1 on merchants m (cost=0.29..1,869.01 rows=16 width=0) (actual time=1.872..1.873 rows=0 loops=1)

  • Index Cond: (m.supports_takeout = true)
  • Filter: (m.supports_takeout AND ((m.location)::geography && '0101000020E6100000978FA4A4872D37C0ACE5CE4C307E47C0'::geography) AND ('0101000020E6100000978FA4A4872D37C0ACE5CE4C307E47C0'::geography && _st_expand((m.location)::geography, '30000'::double precision)) AND _st_dwithin((m.location)::geography, '0101000020E6100000978FA4A4872D37C0ACE5CE4C307E47C0'::geography, '30000'::double precision, true))
  • Buffers: shared hit=548
5. 0.001 0.031 ↓ 0.0 0 1

Nested Loop (cost=130.3..382.27 rows=54 width=0) (actual time=0.031..0.031 rows=0 loops=1)

  • Buffers: shared hit=1
6. 0.001 0.030 ↓ 0.0 0 1

Unique (cost=129.89..130.17 rows=55 width=28) (actual time=0.03..0.03 rows=0 loops=1)

  • Buffers: shared hit=1
7. 0.011 0.029 ↓ 0.0 0 1

Sort (cost=129.89..130.03 rows=55 width=28) (actual time=0.029..0.029 rows=0 loops=1)

  • Sort Key: dels.owner_id, ((dels.mode <> 'EXCLUSION'::delivery_mode)), dels.zipcode COLLATE "C", dels.priority
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=1
8. 0.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.85..128.3 rows=55 width=28) (actual time=0.018..0.018 rows=0 loops=1)

  • Buffers: shared hit=1
9. 0.017 0.017 ↓ 0.0 0 1

Index Scan using polygons_geom_idx on polygons pol (cost=0.42..4.78 rows=1 width=16) (actual time=0.017..0.017 rows=0 loops=1)

  • Index Cond: (pol.geom && '0101000020E6100000978FA4A4872D37C0ACE5CE4C307E47C0'::geometry)
  • Filter: _st_intersects(pol.geom, '0101000020E6100000978FA4A4872D37C0ACE5CE4C307E47C0'::geometry)
  • Buffers: shared hit=1
10. 0.000 0.000 ↓ 0.0 0 0

Index Scan using deliveries_pol_id_idx on deliveries dels (cost=0.43..117.89 rows=55 width=47) (never executed)

  • Index Cond: (dels.pol_id = pol.pol_id)
11. 0.000 0.000 ↓ 0.0 0 0

Index Scan using merchants_pkey on merchants merc (cost=0.41..4.48 rows=1 width=16) (never executed)

  • Index Cond: (merc.merchant_id = dels.owner_id)
  • Filter: merc.supports_delivery