explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pfAe

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 5,326.046 ↑ 6.5 31 1

Sort (cost=6,318,490.39..6,318,490.89 rows=200 width=40) (actual time=5,326.045..5,326.046 rows=31 loops=1)

  • Sort Key: tblmovements.commodity
  • Sort Method: quicksort Memory: 27kB
2. 1.485 5,326.007 ↑ 6.5 31 1

HashAggregate (cost=6,318,475.74..6,318,482.74 rows=200 width=40) (actual time=5,325.992..5,326.007 rows=31 loops=1)

  • Group Key: tblmovements.commodity
3. 0.000 5,324.522 ↑ 9,312.3 2,835 1

Group (cost=1,726,110.57..5,526,468.39 rows=26,400,245 width=55) (actual time=4,308.880..5,324.522 rows=2,835 loops=1)

  • Group Key: tblmovements.trip_id, ((v_transit_movement_extras.mov_cst * '2'::double precision)), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, v_transit_movement_extras.avg_road_speed
4. 0.000 5,759.108 ↑ 9,011.9 2,835 1

Gather Merge (cost=1,726,110.57..4,877,107.53 rows=25,548,624 width=47) (actual time=4,308.872..5,759.108 rows=2,835 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
5. 1,895.492 17,675.812 ↑ 12,011.6 709 4

Group (cost=1,725,110.53..1,874,144.17 rows=8,516,208 width=47) (actual time=3,708.618..4,418.953 rows=709 loops=4)

  • Group Key: tblmovements.trip_id, ((v_transit_movement_extras.mov_cst * '2'::double precision)), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, v_transit_movement_extras.avg_road_speed
6. 5,430.488 15,780.320 ↑ 2.5 3,456,820 4

Sort (cost=1,725,110.53..1,746,401.05 rows=8,516,208 width=47) (actual time=3,708.615..3,945.080 rows=3,456,820 loops=4)

  • Sort Key: tblmovements.trip_id, ((v_transit_movement_extras.mov_cst * '2'::double precision)), v_transit_movement_extras.total_km, v_transit_movement_extras.total_hr, v_transit_movement_extras.avg_road_speed
  • Sort Method: quicksort Memory: 439316kB
  • Worker 0: Sort Method: quicksort Memory: 376195kB
  • Worker 1: Sort Method: quicksort Memory: 501533kB
  • Worker 2: Sort Method: external merge Disk: 214720kB
7. 3,117.776 10,349.832 ↑ 2.5 3,456,820 4

Parallel Hash Left Join (cost=16,190.91..482,844.21 rows=8,516,208 width=47) (actual time=81.107..2,587.458 rows=3,456,820 loops=4)

  • Hash Cond: (tblsegments.trip_id = v_transit_movement_extras.trip_id)
8. 3,328.648 7,107.376 ↑ 2.5 3,456,820 4

Parallel Hash Join (cost=10,335.19..433,342.60 rows=8,516,208 width=35) (actual time=48.507..1,776.844 rows=3,456,820 loops=4)

  • Hash Cond: (tblsegments.trip_id = tblmovements.trip_id)
9. 1,452.997 3,594.036 ↑ 2.5 3,456,820 4

Nested Loop (cost=184.49..400,836.55 rows=8,516,208 width=16) (actual time=1.713..898.509 rows=3,456,820 loops=4)

10. 5.060 6.284 ↑ 4.4 709 4

Parallel Bitmap Heap Scan on tblsegments tblsegments_1 (cost=183.92..37,087.49 rows=3,136 width=8) (actual time=1.280..1.571 rows=709 loops=4)

  • Recheck Cond: (link_id = 1464746470)
  • Heap Blocks: exact=7
11. 1.224 1.224 ↑ 3.4 2,835 1

Bitmap Index Scan on seglink (cost=0.00..181.49 rows=9,723 width=0) (actual time=1.224..1.224 rows=2,835 loops=1)

  • Index Cond: (link_id = 1464746470)
12. 2,134.755 2,134.755 ↓ 1.8 4,877 2,835

Index Only Scan using idx_tblsegments_keyrev on tblsegments (cost=0.57..89.21 rows=2,678 width=16) (actual time=0.016..0.753 rows=4,877 loops=2,835)

  • Index Cond: (trip_id = tblsegments_1.trip_id)
  • Heap Fetches: 0
13. 94.928 184.692 ↑ 1.7 75,192 4

Parallel Hash (cost=8,584.20..8,584.20 rows=125,320 width=27) (actual time=46.173..46.173 rows=75,192 loops=4)

  • Buckets: 524288 Batches: 1 Memory Usage: 23776kB
14. 89.764 89.764 ↑ 1.7 75,192 4

Parallel Seq Scan on tblmovements (cost=0.00..8,584.20 rows=125,320 width=27) (actual time=0.374..22.441 rows=75,192 loops=4)

15. 75.348 124.680 ↑ 2.4 74,662 4

Parallel Hash (cost=3,659.76..3,659.76 rows=175,676 width=24) (actual time=31.170..31.170 rows=74,662 loops=4)

  • Buckets: 524288 Batches: 1 Memory Usage: 20480kB
16. 49.332 49.332 ↑ 2.4 74,662 4

Parallel Seq Scan on v_transit_movement_extras (cost=0.00..3,659.76 rows=175,676 width=24) (actual time=0.228..12.333 rows=74,662 loops=4)