explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I0FC : Optimization for: plan #Loop

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.059 4,061.414 ↑ 1.0 1 1

Aggregate (cost=122.68..122.69 rows=1 width=8) (actual time=4,061.414..4,061.414 rows=1 loops=1)

2. 40.356 4,061.355 ↓ 38.0 38 1

Nested Loop (cost=1.42..122.68 rows=1 width=4) (actual time=5.945..4,061.355 rows=38 loops=1)

3. 16.429 3,953.564 ↓ 67,435.0 67,435 1

Nested Loop (cost=1.14..122.11 rows=1 width=8) (actual time=0.201..3,953.564 rows=67,435 loops=1)

4. 1.105 37.420 ↓ 3,485.0 3,485 1

Nested Loop (cost=0.86..121.56 rows=1 width=36) (actual time=0.059..37.420 rows=3,485 loops=1)

5. 18.890 18.890 ↓ 3,485.0 3,485 1

Index Scan using idx_abstract_reservation_selectedstartdate on md_abstract_reservation m0_ (cost=0.43..113.10 rows=1 width=8) (actual time=0.045..18.890 rows=3,485 loops=1)

  • Index Cond: ((selectedstartdate >= now()) AND (selectedstartdate <= (now() + '10 days'::interval)))
  • Filter: (((status)::text = ANY ('{ACCEPTED,REQUESTED}'::text[])) AND ((type)::text = 'DISTANCE'::text))
  • Rows Removed by Filter: 1484
6. 17.425 17.425 ↑ 1.0 1 3,485

Index Scan using idx_location_cityarea on md_location m1_ (cost=0.43..8.45 rows=1 width=36) (actual time=0.004..0.005 rows=1 loops=3,485)

  • Index Cond: (id = m0_.origin_id)
7. 3,899.715 3,899.715 ↓ 19.0 19 3,485

Index Scan using idx_polygon on md_polygon m2_ (cost=0.28..0.54 rows=1 width=166) (actual time=0.317..1.119 rows=19 loops=3,485)

  • Index Cond: (polygon && m1_.point)
  • Filter: _st_covers(polygon, m1_.point)
  • Rows Removed by Filter: 1
8. 67.435 67.435 ↓ 0.0 0 67,435

Index Scan using uniq_a8fb057924c7c0fb on md_area m3_ (cost=0.28..0.56 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=67,435)

  • Index Cond: (polygon_id = m2_.id)
  • Filter: (id = 2)
  • Rows Removed by Filter: 1