explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xMMQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.091 690.314 ↓ 142.9 1,000 1

Limit (cost=1.55..123,882.01 rows=7 width=62) (actual time=0.602..690.314 rows=1,000 loops=1)

  • Output: d.owner_id, d.del_id, d.pol_id, d.delivered_by, p.label
  • Buffers: shared hit=1,699,729
2. 0.000 690.223 ↓ 142.9 1,000 1

Nested Loop Semi Join (cost=1.55..123,882.01 rows=7 width=62) (actual time=0.601..690.223 rows=1,000 loops=1)

  • Output: d.owner_id, d.del_id, d.pol_id, d.delivered_by, p.label
  • Buffers: shared hit=1,699,729
3. 4.913 242.618 ↓ 5,969.4 41,786 1

Nested Loop (cost=0.99..123,814.29 rows=7 width=62) (actual time=0.587..242.618 rows=41,786 loops=1)

  • Output: d.owner_id, d.del_id, d.pol_id, d.delivered_by, p.label
  • Buffers: shared hit=264,348
4. 52.353 52.353 ↓ 258.9 46,338 1

Index Scan using polygons_details_type_idx on ifood_region.polygons p (cost=0.43..18,115.99 rows=179 width=21) (actual time=0.019..52.353 rows=46,338 loops=1)

  • Output: p.pol_id, p.type, p.kml, p.geom, p.status, p.owner_id, p.details, p.creation_date, p.country, p.state, p.city, p.label, p.last_updated
  • Index Cond: ((p.details ->> 'type'::text) IS NULL)
  • Filter: ((p.details ->> 'method'::text) = 'radius'::text)
  • Rows Removed by Filter: 2,217
  • Buffers: shared hit=32,112
5. 185.352 185.352 ↑ 16.0 1 46,338

Index Scan using delivery_polygons on ifood_region.deliveries d (cost=0.56..588.89 rows=16 width=57) (actual time=0.004..0.004 rows=1 loops=46,338)

  • Output: d.del_id, d.pol_id, d.owner_id, d.mode, d.priority, d.status, d.time_formula, d.fee_formula, d.creation_date, d.last_updated, d.delivered_by, d.hub_id, d.region_id, d.delivery_method_id
  • Index Cond: (d.pol_id = p.pol_id)
  • Filter: (d.delivered_by = 'IFOOD'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=232,236
6. 459.646 459.646 ↓ 0.0 0 41,786

Index Scan using deliveries_parameters_owner_id_type_delivered_by_radiusx on ifood_region.deliveries_parameters dp2 (cost=0.56..118.94 rows=19 width=23) (actual time=0.011..0.011 rows=0 loops=41,786)

  • Output: dp2.id, dp2.owner_id, dp2.radius, dp2.type, dp2.fee, dp2.""time"", dp2.status, dp2.creation_date, dp2.last_updated, dp2.delivered_by, dp2.region_id, dp2.del_id
  • Index Cond: ((dp2.owner_id = d.owner_id) AND (dp2.delivered_by = 'IFOOD'::text))
  • Filter: (dp2.del_id IS NULL)
  • Rows Removed by Filter: 13
  • Buffers: shared hit=1,435,381
Planning time : 1.206 ms
Execution time : 690.409 ms