explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g8H1

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 114.891 ↑ 6,518,406.5 4 1

Group (cost=4,043,445.24..7,659,527.22 rows=26,073,626 width=118) (actual time=114.756..114.891 rows=4 loops=1)

  • Group Key: tblmovements.trip_id, ((tblmovements.tonnes)::real), ((tblmovements.tonnes_per_trailer)::real), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, ((v_transit_movement_extras.mov_cst * '2'::double precision))
2. 0.000 265.344 ↑ 5,432,005.5 4 1

Gather Merge (cost=4,043,445.24..6,877,318.44 rows=21,728,022 width=114) (actual time=114.753..265.344 rows=4 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.165 306.048 ↑ 10,864,011.0 1 3

Group (cost=4,042,445.22..4,368,365.55 rows=10,864,011 width=114) (actual time=101.944..102.016 rows=1 loops=3)

  • Group Key: tblmovements.trip_id, ((tblmovements.tonnes)::real), ((tblmovements.tonnes_per_trailer)::real), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, ((v_transit_movement_extras.mov_cst * '2'::double precision))
4. 0.585 305.883 ↑ 30,431.4 357 3

Sort (cost=4,042,445.22..4,069,605.25 rows=10,864,011 width=114) (actual time=101.943..101.961 rows=357 loops=3)

  • Sort Key: tblmovements.trip_id, ((tblmovements.tonnes)::real), ((tblmovements.tonnes_per_trailer)::real), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, ((v_transit_movement_extras.mov_cst * '2'::double precision))
  • Sort Method: quicksort Memory: 197kB
  • Worker 0: Sort Method: quicksort Memory: 137kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
5. 10.350 305.298 ↑ 30,431.4 357 3

Merge Left Join (cost=25,623.88..767,645.17 rows=10,864,011 width=114) (actual time=101.222..101.766 rows=357 loops=3)

  • Merge Cond: (tblsegments.trip_id = v_transit_movement_extras.trip_id)
6. 0.169 272.196 ↑ 30,431.4 357 3

Nested Loop (cost=25,623.00..485,630.15 rows=10,864,011 width=101) (actual time=90.353..90.732 rows=357 loops=3)

7. 5.424 271.719 ↑ 4,023.0 1 3

Merge Join (cost=25,622.43..26,634.20 rows=4,023 width=101) (actual time=90.328..90.573 rows=1 loops=3)

  • Merge Cond: (tblmovements.trip_id = tblsegments_1.trip_id)
8. 169.152 265.380 ↑ 4.8 25,991 3

Sort (cost=25,621.83..25,935.13 rows=125,320 width=93) (actual time=84.919..88.460 rows=25,991 loops=3)

  • Sort Key: tblmovements.trip_id
  • Sort Method: external merge Disk: 12384kB
  • Worker 0: Sort Method: external merge Disk: 9896kB
  • Worker 1: Sort Method: external merge Disk: 10656kB
9. 96.228 96.228 ↑ 1.2 100,256 3

Parallel Seq Scan on tblmovements (cost=0.00..8,584.20 rows=125,320 width=93) (actual time=0.143..32.076 rows=100,256 loops=3)

10. 0.915 0.915 ↑ 2,413.8 4 3

Index Only Scan using idx_tblsegments_key on tblsegments tblsegments_1 (cost=0.57..321.53 rows=9,655 width=8) (actual time=0.303..0.305 rows=4 loops=3)

  • Index Cond: (link_id = 1195728634)
  • Heap Fetches: 0
11. 0.308 0.308 ↑ 10.0 268 4

Index Only Scan using idx_tblsegments_keyrev on tblsegments (cost=0.57..87.27 rows=2,682 width=16) (actual time=0.023..0.077 rows=268 loops=4)

  • Index Cond: (trip_id = tblmovements.trip_id)
  • Heap Fetches: 0
12. 22.752 22.752 ↑ 4.3 69,231 2

Index Scan using v_transit_movement_extras_trip_id on v_transit_movement_extras (cost=0.42..9,670.17 rows=298,650 width=20) (actual time=0.017..11.376 rows=69,231 loops=2)