explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XgPX

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 49.519 336.397 ↑ 10.1 32 1

HashAggregate (cost=43,743.95..43,747.99 rows=323 width=21) (actual time=336.389..336.397 rows=32 loops=1)

  • Group Key: rtrd.road_damage_value
2.          

Initplan (for HashAggregate)

3. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on road_damage_types rdt (cost=0.00..1.18 rows=1 width=4) (actual time=0.012..0.013 rows=1 loops=1)

  • Filter: ((road_damage_type_name)::text = 'road_seams'::text)
  • Rows Removed by Filter: 13
4. 66.571 286.865 ↑ 1.0 128,184 1

Merge Join (cost=0.92..42,754.30 rows=131,797 width=9) (actual time=1.968..286.865 rows=128,184 loops=1)

  • Merge Cond: (rtrd.record_data_id = r.record_data_id)
5. 144.144 144.144 ↑ 1.0 167,146 1

Index Scan using records_to_road_damage_pkey on records_to_road_damage rtrd (cost=0.43..31,830.71 rows=172,104 width=9) (actual time=1.957..144.144 rows=167,146 loops=1)

  • Index Cond: (road_damage_type_id = $0)
6. 76.150 76.150 ↓ 1.0 128,699 1

Index Scan using records_pkey on records r (cost=0.42..8,967.34 rows=128,397 width=4) (actual time=0.008..76.150 rows=128,699 loops=1)

  • Filter: (is_latest_until IS NULL)
  • Rows Removed by Filter: 39047
Planning time : 4.941 ms
Execution time : 336.457 ms