explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nI1c

Settings
# exclusive inclusive rows x rows loops node
1. 0.578 37.460 ↓ 29.0 29 1

WindowAgg (cost=69.57..69.97 rows=1 width=837) (actual time=37.047..37.460 rows=29 loops=1)

2. 0.081 36.882 ↓ 29.0 29 1

Sort (cost=69.57..69.57 rows=1 width=487) (actual time=36.879..36.882 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. 0.333 36.801 ↓ 29.0 29 1

Nested Loop (cost=2.28..69.56 rows=1 width=487) (actual time=4.690..36.801 rows=29 loops=1)

4. 0.037 32.640 ↓ 29.0 29 1

Nested Loop (cost=1.84..60.85 rows=1 width=358) (actual time=2.366..32.640 rows=29 loops=1)

5. 0.031 32.545 ↓ 29.0 29 1

Nested Loop (cost=1.70..52.62 rows=1 width=295) (actual time=2.355..32.545 rows=29 loops=1)

6. 0.102 32.021 ↓ 29.0 29 1

Nested Loop (cost=1.27..35.39 rows=1 width=267) (actual time=2.123..32.021 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.022 31.513 ↓ 29.0 29 1

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

8. 0.040 3.245 ↓ 29.0 29 1

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

9. 3.089 3.089 ↓ 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=1.025..3.089 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.116 0.116 ↑ 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.004..0.004 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.control_object_id)
11. 28.246 28.246 ↑ 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.974..0.974 rows=1 loops=29)

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

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

13. 0.493 0.493 ↑ 1.0 1 29

Index Scan using location_pkey on location (cost=0.43..8.83 rows=1 width=36) (actual time=0.017..0.017 rows=1 loops=29)

  • Index Cond: (id = snapshot_scheduled_inspection.location_id)
  • Filter: ((geo_point && '0101000020E61000000000002098CF4240000000609AE94B40'::geography) AND ('0101000020E61000000000002098CF4240000000609AE94B40'::geography && _st_expand(geo_point, '36110'::double precision)) AND _st_dwithin(geo_point, '0101000020E61000000000002098CF4240000000609AE94B40'::geography, '36110'::double precision, true))
14. 0.058 0.058 ↑ 1.0 1 29

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

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

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

  • Index Cond: (id = snapshot_scheduled_inspection.execution_id)
Planning time : 7.866 ms
Execution time : 37.835 ms