explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9aKx

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

Group (cost=4,043,445.24..7,659,527.22 rows=26,073,626 width=118) (actual time=111.644..111.781 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 143.694 ↑ 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=111.642..143.694 rows=4 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.168 297.480 ↑ 10,864,011.0 1 3

Group (cost=4,042,445.22..4,368,365.55 rows=10,864,011 width=114) (actual time=99.087..99.160 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.594 297.312 ↑ 30,431.4 357 3

Sort (cost=4,042,445.22..4,069,605.25 rows=10,864,011 width=114) (actual time=99.086..99.104 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: 25kB
  • Worker 1: Sort Method: quicksort Memory: 137kB
5. 10.821 296.718 ↑ 30,431.4 357 3

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

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

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

7. 5.628 262.206 ↑ 4,023.0 1 3

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

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

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

  • Sort Key: tblmovements.trip_id
  • Sort Method: external merge Disk: 12208kB
  • Worker 0: Sort Method: external merge Disk: 10336kB
  • Worker 1: Sort Method: external merge Disk: 10392kB
9. 92.643 92.643 ↑ 1.2 100,256 3

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

10. 0.816 0.816 ↑ 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.271..0.272 rows=4 loops=3)

  • Index Cond: (link_id = 1195728634)
  • Heap Fetches: 0
11. 0.304 0.304 ↑ 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.076 rows=268 loops=4)

  • Index Cond: (trip_id = tblmovements.trip_id)
  • Heap Fetches: 0
12. 23.226 23.226 ↑ 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.613 rows=69,231 loops=2)