explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mo3u

Settings
# exclusive inclusive rows x rows loops node
1. 44,038.217 75,255.240 ↑ 1.0 1 1

Aggregate (cost=59,597.86..59,597.87 rows=1 width=32) (actual time=75,255.239..75,255.240 rows=1 loops=1)

2. 6,686.502 31,217.023 ↓ 731.1 3,819,120 1

Subquery Scan on q (cost=21,792.22..59,584.80 rows=5,224 width=438) (actual time=19,195.674..31,217.023 rows=3,819,120 loops=1)

3. 5,082.002 24,530.521 ↓ 731.1 3,819,120 1

Hash Join (cost=21,792.22..59,532.56 rows=5,224 width=414) (actual time=19,195.634..24,530.521 rows=3,819,120 loops=1)

  • Hash Cond: (road_movements.trip_id = s.trip_id)
4.          

CTE boundaries

5. 0.000 0.000 ↓ 0.0 0

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

6. 283.115 283.115 ↑ 1.0 582,725 1

Seq Scan on road_movements (cost=0.00..32,589.25 rows=582,725 width=314) (actual time=0.025..283.115 rows=582,725 loops=1)

7. 2,637.771 19,165.404 ↓ 731.1 3,819,120 1

Hash (cost=20,816.46..20,816.46 rows=5,224 width=108) (actual time=19,165.404..19,165.404 rows=3,819,120 loops=1)

  • Buckets: 4194304 (originally 8192) Batches: 1 (originally 1) Memory Usage: 713920kB
8. 1,241.742 16,527.633 ↓ 731.1 3,819,120 1

Nested Loop (cost=303.94..20,816.46 rows=5,224 width=108) (actual time=6.710..16,527.633 rows=3,819,120 loops=1)

9. 37.336 42.873 ↓ 417.0 417 1

GroupAggregate (cost=174.88..174.98 rows=1 width=246) (actual time=4.550..42.873 rows=417 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
10. 1.453 5.537 ↓ 417.0 417 1

Sort (cost=174.88..174.89 rows=1 width=206) (actual time=4.460..5.537 rows=417 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: 145kB
11. 0.273 4.084 ↓ 417.0 417 1

Nested Loop Left Join (cost=4.73..174.87 rows=1 width=206) (actual time=0.251..4.084 rows=417 loops=1)

  • Join Filter: NULL::boolean
12. 3.703 3.811 ↓ 417.0 417 1

Bitmap Heap Scan on v_transit_roads (cost=4.73..174.86 rows=1 width=206) (actual time=0.248..3.811 rows=417 loops=1)

  • Recheck Cond: ((street_name)::text = ANY ('{"Gore Hwy"}'::text[]))
  • Filter: ((geometry && '0103000020110F00000100000005000000EC511814C3F26F41CDCCCC56F6E247C1EC511814C3F26F410AD723DBB51449C13D0A977A991F70410AD723DBB51449C13D0A977A991F7041CDCCCC56F6E247C1EC511814C3F26F41CDCCCC56F6E247C1'::geometry) AND _st_intersects(geometry, '0103000020110F00000100000005000000EC511814C3F26F41CDCCCC56F6E247C1EC511814C3F26F410AD723DBB51449C13D0A977A991F70410AD723DBB51449C13D0A977A991F7041CDCCCC56F6E247C1EC511814C3F26F41CDCCCC56F6E247C1'::geometry))
  • Rows Removed by Filter: 32
  • Heap Blocks: exact=119
13. 0.108 0.108 ↓ 11.0 449 1

Bitmap Index Scan on idx_v_transit_roads_street_name (cost=0.00..4.73 rows=41 width=0) (actual time=0.108..0.108 rows=449 loops=1)

  • Index Cond: ((street_name)::text = ANY ('{"Gore Hwy"}'::text[]))
14. 0.000 0.000 ↓ 0.0 0 417

Result (cost=0.00..0.00 rows=0 width=0) (actual time=0.000..0.000 rows=0 loops=417)

  • One-Time Filter: false
15. 14,301.849 15,243.018 ↓ 1.8 9,159 417

Bitmap Heap Scan on road_segments s (cost=129.06..20,589.23 rows=5,224 width=32) (actual time=3.936..36.554 rows=9,159 loops=417)

  • Recheck Cond: (link_id = ((v_transit_roads.link_id)::integer))
  • Heap Blocks: exact=3819039
16. 941.169 941.169 ↓ 1.8 9,159 417

Bitmap Index Scan on idx_road_segments_link_id (cost=0.00..127.76 rows=5,224 width=0) (actual time=2.257..2.257 rows=9,159 loops=417)

  • Index Cond: (link_id = ((v_transit_roads.link_id)::integer))
Planning time : 62.181 ms