explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 13LM

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,349.827 ↑ 27,047.3 964 1

Group (cost=4,043,445.24..7,659,527.22 rows=26,073,626 width=118) (actual time=1,127.221..1,349.827 rows=964 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 1,522.049 ↑ 22,539.4 964 1

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

  • Workers Planned: 2
  • Workers Launched: 2
3. 274.581 3,534.723 ↑ 33,844.3 321 3

Group (cost=4,042,445.22..4,368,365.55 rows=10,864,011 width=114) (actual time=991.073..1,178.241 rows=321 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. 1,403.316 3,260.142 ↑ 18.5 587,840 3

Sort (cost=4,042,445.22..4,069,605.25 rows=10,864,011 width=114) (actual time=991.068..1,086.714 rows=587,840 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: external merge Disk: 85848kB
  • Worker 0: Sort Method: external merge Disk: 70504kB
  • Worker 1: Sort Method: external merge Disk: 68368kB
5. 865.884 1,856.826 ↑ 18.5 587,840 3

Merge Left Join (cost=25,623.88..767,645.17 rows=10,864,011 width=114) (actual time=98.673..618.942 rows=587,840 loops=3)

  • Merge Cond: (tblsegments.trip_id = v_transit_movement_extras.trip_id)
6. 256.259 860.490 ↑ 18.5 587,840 3

Nested Loop (cost=25,623.00..485,630.15 rows=10,864,011 width=101) (actual time=95.712..286.830 rows=587,840 loops=3)

7. 21.522 351.663 ↑ 12.5 321 3

Merge Join (cost=25,622.43..26,634.20 rows=4,023 width=101) (actual time=95.681..117.221 rows=321 loops=3)

  • Merge Cond: (tblmovements.trip_id = tblsegments_1.trip_id)
8. 234.285 328.962 ↑ 1.3 98,586 3

Sort (cost=25,621.83..25,935.13 rows=125,320 width=93) (actual time=95.353..109.654 rows=98,586 loops=3)

  • Sort Key: tblmovements.trip_id
  • Sort Method: external merge Disk: 13760kB
  • Worker 0: Sort Method: external merge Disk: 8816kB
  • Worker 1: Sort Method: external merge Disk: 10392kB
9. 94.677 94.677 ↑ 1.2 100,256 3

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

10. 1.179 1.179 ↑ 10.0 964 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.208..0.393 rows=964 loops=3)

  • Index Cond: (link_id = 945895182)
  • Heap Fetches: 0
11. 252.568 252.568 ↑ 1.5 1,829 964

Index Only Scan using idx_tblsegments_keyrev on tblsegments (cost=0.57..87.27 rows=2,682 width=16) (actual time=0.011..0.262 rows=1,829 loops=964)

  • Index Cond: (trip_id = tblmovements.trip_id)
  • Heap Fetches: 0
12. 130.452 130.452 ↑ 1.1 281,030 3

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.021..43.484 rows=281,030 loops=3)