explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lTBt

Settings
# exclusive inclusive rows x rows loops node
1. 0.242 17,771.528 ↑ 1.0 1 1

Aggregate (cost=10,015,758,314.18..10,015,758,314.19 rows=1 width=32) (actual time=17,771.528..17,771.528 rows=1 loops=1)

2. 0.325 17,771.286 ↑ 3.1 274 1

Subquery Scan on q (cost=10,015,758,032.67..10,015,758,312.05 rows=850 width=44) (actual time=17,584.287..17,771.286 rows=274 loops=1)

3. 184.992 17,770.961 ↑ 3.1 274 1

GroupAggregate (cost=10,015,758,032.67..10,015,758,303.55 rows=850 width=255) (actual time=17,584.271..17,770.961 rows=274 loops=1)

  • Group Key: v_transit_roads.link_id, v_transit_roads.street_name, v_transit_roads.road_speed, v_transit_roads.road_rank, v_transit_roads.truck, v_transit_roads.surface, v_transit_roads.road_km, v_transit_roads.geometry
4.          

CTE boundaries

5. 0.000 0.000 ↓ 0.0 0

Seq Scan on v_transit_boundaries (cost=10,000,000,000.00..10,000,000,910.46 rows=3,346 width=75,373) (never executed)

6. 82.459 17,585.969 ↓ 9.3 36,284 1

Sort (cost=15,757,122.21..15,757,131.91 rows=3,882 width=211) (actual time=17,582.770..17,585.969 rows=36,284 loops=1)

  • Sort Key: v_transit_roads.link_id, v_transit_roads.street_name, v_transit_roads.road_speed, v_transit_roads.road_rank, v_transit_roads.truck, v_transit_roads.surface, v_transit_roads.road_km, v_transit_roads.geometry
  • Sort Method: quicksort Memory: 12500kB
7. 24.224 17,503.510 ↓ 9.3 36,284 1

Nested Loop Left Join (cost=10,885.02..15,756,890.79 rows=3,882 width=211) (actual time=112.358..17,503.510 rows=36,284 loops=1)

  • Join Filter: NULL::boolean
8. 757.912 17,479.286 ↓ 9.3 36,284 1

Hash Join (cost=10,885.02..15,756,851.97 rows=3,882 width=211) (actual time=112.354..17,479.286 rows=36,284 loops=1)

  • Hash Cond: (road_segments.trip_id = road_movements.trip_id)
9. 817.971 16,711.532 ↓ 4.8 2,799,258 1

Nested Loop (cost=187.26..15,744,633.32 rows=579,383 width=195) (actual time=1.272..16,711.532 rows=2,799,258 loops=1)

10. 53.009 53.823 ↓ 3.4 2,881 1

Bitmap Heap Scan on v_transit_roads (cost=91.63..8,373.54 rows=850 width=187) (actual time=0.997..53.823 rows=2,881 loops=1)

  • Recheck Cond: (geometry && '0103000020110F000001000000050000008FC2B976272970415C8FE237662F48C18FC2B97627297041EC51F818D67B48C1E17ADC72B5327041EC51F818D67B48C1E17ADC72B53270415C8FE237662F48C18FC2B976272970415C8FE237662F48C1'::geometry)
  • Filter: _st_intersects(geometry, '0103000020110F000001000000050000008FC2B976272970415C8FE237662F48C18FC2B97627297041EC51F818D67B48C1E17ADC72B5327041EC51F818D67B48C1E17ADC72B53270415C8FE237662F48C18FC2B976272970415C8FE237662F48C1'::geometry)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=599
11. 0.814 0.814 ↓ 1.1 2,882 1

Bitmap Index Scan on v_transit_roads_geometry_geom_idx (cost=0.00..91.42 rows=2,551 width=0) (actual time=0.814..0.814 rows=2,882 loops=1)

  • Index Cond: (geometry && '0103000020110F000001000000050000008FC2B976272970415C8FE237662F48C18FC2B97627297041EC51F818D67B48C1E17ADC72B5327041EC51F818D67B48C1E17ADC72B53270415C8FE237662F48C18FC2B976272970415C8FE237662F48C1'::geometry)
12. 15,280.824 15,839.738 ↑ 5.2 972 2,881

Bitmap Heap Scan on road_segments (cost=95.63..18,462.60 rows=5,065 width=16) (actual time=0.369..5.498 rows=972 loops=2,881)

  • Recheck Cond: (link_id = v_transit_roads.link_id)
  • Heap Blocks: exact=2799258
13. 558.914 558.914 ↑ 5.2 972 2,881

Bitmap Index Scan on idx_road_segments_link_id (cost=0.00..94.36 rows=5,065 width=0) (actual time=0.194..0.194 rows=972 loops=2,881)

  • Index Cond: (link_id = v_transit_roads.link_id)
14. 1.092 9.842 ↓ 1.1 4,113 1

Hash (cost=10,648.96..10,648.96 rows=3,904 width=32) (actual time=9.841..9.842 rows=4,113 loops=1)

  • Buckets: 8192 (originally 4096) Batches: 1 (originally 1) Memory Usage: 322kB
15. 8.199 8.750 ↓ 1.1 4,113 1

Bitmap Heap Scan on road_movements (cost=74.68..10,648.96 rows=3,904 width=32) (actual time=0.909..8.750 rows=4,113 loops=1)

  • Recheck Cond: (commod_id = ANY ('{2}'::integer[]))
  • Heap Blocks: exact=2378
16. 0.551 0.551 ↓ 1.1 4,113 1

Bitmap Index Scan on idx_road_movements_commod_id (cost=0.00..73.70 rows=3,904 width=0) (actual time=0.551..0.551 rows=4,113 loops=1)

  • Index Cond: (commod_id = ANY ('{2}'::integer[]))
17. 0.000 0.000 ↓ 0.0 0 36,284

Result (cost=0.00..0.00 rows=0 width=0) (actual time=0.000..0.000 rows=0 loops=36,284)

  • One-Time Filter: false
Planning time : 8.422 ms