explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 24MV

Settings
# exclusive inclusive rows x rows loops node
1. 0.581 33,385.667 ↓ 29.0 29 1

WindowAgg (cost=61.16..61.56 rows=1 width=837) (actual time=33,385.349..33,385.667 rows=29 loops=1)

2. 0.336 33,385.086 ↓ 29.0 29 1

Sort (cost=61.16..61.17 rows=1 width=487) (actual time=33,385.084..33,385.086 rows=29 loops=1)

  • Sort Key: snapshot_scheduled_inspection.project_id, (_st_distance(location.geo_point, '0101000020E61000000000002098CF4240000000609AE94B40'::geography, '0'::double precision, true))
  • Sort Method: quicksort Memory: 41kB
3. 1.116 33,384.750 ↓ 29.0 29 1

Nested Loop (cost=2.27..61.15 rows=1 width=487) (actual time=1,178.391..33,384.750 rows=29 loops=1)

4. 0.464 33,383.228 ↓ 29.0 29 1

Nested Loop (cost=1.83..52.45 rows=1 width=358) (actual time=1,177.684..33,383.228 rows=29 loops=1)

5. 523.953 33,382.445 ↓ 29.0 29 1

Nested Loop (cost=1.68..44.21 rows=1 width=295) (actual time=1,177.564..33,382.445 rows=29 loops=1)

  • Join Filter: (snapshot_scheduled_inspection.location_id = location.id)
  • Rows Removed by Join Filter: 8439116
6. 0.335 1.869 ↓ 29.0 29 1

Nested Loop (cost=1.27..35.39 rows=1 width=267) (actual time=0.066..1.869 rows=29 loops=1)

  • Join Filter: (snapshot_scheduled_inspection.planned_work_status_id = planned_work_status.id)
  • Rows Removed by Join Filter: 140
7. 0.254 1.447 ↓ 29.0 29 1

Nested Loop (cost=1.27..34.19 rows=1 width=235) (actual time=0.054..1.447 rows=29 loops=1)

8. 0.343 0.874 ↓ 29.0 29 1

Nested Loop (cost=0.85..25.75 rows=1 width=145) (actual time=0.037..0.874 rows=29 loops=1)

9. 0.241 0.241 ↓ 29.0 29 1

Index Scan using snapshot_scheduled_inspection_actor_id_project_id_visible_id_ac on snapshot_scheduled_inspection (cost=0.41..17.30 rows=1 width=69) (actual time=0.019..0.241 rows=29 loops=1)

  • Index Cond: ((actor_id = '-1'::integer) AND (project_id = ANY ('{100175,156641,159370}'::integer[])) AND (visible_id = 1) AND (actuality = 0))
10. 0.290 0.290 ↑ 1.0 1 29

Index Scan using control_object_pkey on control_object (cost=0.43..8.45 rows=1 width=80) (actual time=0.010..0.010 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.control_object_id)
11. 0.319 0.319 ↑ 1.0 1 29

Index Scan using control_subject_pkey on control_subject (cost=0.42..8.44 rows=1 width=94) (actual time=0.011..0.011 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.control_subject_id)
12. 0.087 0.087 ↑ 1.5 6 29

Seq Scan on planned_work_status (cost=0.00..1.09 rows=9 width=36) (actual time=0.002..0.003 rows=6 loops=29)

13. 32,856.623 32,856.623 ↓ 291,005.0 291,005 29

Index Scan using location_gix on location (cost=0.41..8.81 rows=1 width=36) (actual time=0.362..1,132.987 rows=291,005 loops=29)

  • Index Cond: (geo_point && '0101000020E61000000000002098CF4240000000609AE94B40'::geography)
  • Filter: (('0101000020E61000000000002098CF4240000000609AE94B40'::geography && _st_expand(geo_point, '36110'::double precision)) AND _st_dwithin(geo_point, '0101000020E61000000000002098CF4240000000609AE94B40'::geography, '36110'::double precision, true))
  • Rows Removed by Filter: 99190
14. 0.319 0.319 ↑ 1.0 1 29

Index Scan using stage_pkey on stage (cost=0.15..8.17 rows=1 width=71) (actual time=0.011..0.011 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.stage_id)
  • Filter: ((kind = 0) AND (status_stage_id = 2))
15. 0.406 0.406 ↑ 1.0 1 29

Index Scan using execution_pkey on execution (cost=0.44..8.46 rows=1 width=125) (actual time=0.014..0.014 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.execution_id)
Planning time : 3.573 ms
Execution time : 33,386.030 ms