explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rjKT

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 97.806 925.804 ↓ 7.6 69,150 1

GroupAggregate (cost=69,701.14..70,250.44 rows=9,155 width=56) (actual time=813.067..925.804 rows=69,150 loops=1)

  • Group Key: sd.segment_id
2. 80.285 827.998 ↓ 11.8 108,219 1

Sort (cost=69,701.14..69,724.02 rows=9,155 width=63) (actual time=813.048..827.998 rows=108,219 loops=1)

  • Sort Key: sd.segment_id
  • Sort Method: external merge Disk: 7808kB
3. 2.102 747.713 ↓ 11.8 108,219 1

Nested Loop (cost=1,012.18..69,098.72 rows=9,155 width=63) (actual time=0.345..747.713 rows=108,219 loops=1)

4. 134.417 257.323 ↓ 10.0 122,072 1

Gather (cost=1,011.76..26,247.52 rows=12,207 width=7) (actual time=0.323..257.323 rows=122,072 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
5. 64.678 122.906 ↓ 7.7 30,518 4

Hash Join (cost=11.76..24,026.82 rows=3,938 width=7) (actual time=0.137..122.906 rows=30,518 loops=4)

  • Hash Cond: (ssdrd.road_damage_type_id = rd.road_damage_type_id)
6. 58.209 58.209 ↑ 1.3 427,252 4

Parallel Seq Scan on segment_data_to_road_damage ssdrd (cost=0.00..17,089.93 rows=551,293 width=11) (actual time=0.012..58.209 rows=427,252 loops=4)

7. 0.004 0.019 ↑ 1.0 1 4

Hash (cost=11.75..11.75 rows=1 width=4) (actual time=0.019..0.019 rows=1 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.015 0.015 ↑ 1.0 1 4

Seq Scan on road_damage_types rd (cost=0.00..11.75 rows=1 width=4) (actual time=0.014..0.015 rows=1 loops=4)

  • Filter: ((road_damage_type_name)::text = 'emi_raw'::text)
  • Rows Removed by Filter: 13
9. 311.085 488.288 ↑ 1.0 1 122,072

Index Scan using segment_data_pkey on segment_data sd (cost=0.42..3.51 rows=1 width=60) (actual time=0.004..0.004 rows=1 loops=122,072)

  • Index Cond: (segment_data_id = ssdrd.segment_data_id)
  • Filter: ((SubPlan 1) OR (SubPlan 2))
  • Rows Removed by Filter: 0
10.          

SubPlan (for Index Scan)

11. 0.000 122.072 ↑ 1.0 1 122,072

Limit (cost=0.42..2.65 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=122,072)

12. 122.072 122.072 ↑ 1.0 1 122,072

Index Scan Backward using segment_data_segment_id_timeslot_direction_key on segment_data j (cost=0.42..2.65 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=122,072)

  • Index Cond: ((segment_id = sd.segment_id) AND (direction = 1))
13. 0.000 55.131 ↑ 1.0 1 55,131

Limit (cost=0.42..2.65 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=55,131)

14. 55.131 55.131 ↑ 1.0 1 55,131

Index Scan Backward using segment_data_segment_id_timeslot_direction_key on segment_data j_1 (cost=0.42..2.65 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=55,131)

  • Index Cond: ((segment_id = sd.segment_id) AND (direction = '-1'::integer))
Planning time : 0.435 ms
Execution time : 932.546 ms