explain.depesz.com

PostgreSQL's explain analyze made readable

Result: y4te

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=10,433,944.45..10,433,944.46 rows=1 width=8) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Hash Join (cost=421.06..10,433,744.17 rows=80,111 width=8) (actual rows= loops=)

  • Hash Cond: (sv.road_station_id = rs.id)
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..10,430,928.88 rows=425,059 width=13) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.42..203.71 rows=78 width=5) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Scan using road_station_sensor_pk on road_station_sensor s (cost=0.28..105.78 rows=524 width=23) (actual rows= loops=)

  • Filter: publishable
6. 0.000 0.000 ↓ 0.0

Index Only Scan using allowed_road_station_sensor_ui on allowed_road_station_sensor allowed (cost=0.14..0.19 rows=1 width=19) (actual rows= loops=)

  • Index Cond: ((natural_id = s.natural_id) AND (road_station_type = (s.road_station_type)::text))
7. 0.000 0.000 ↓ 0.0

Index Scan using sensor_value_uk1 on sensor_value sv (cost=0.43..133,373.70 rows=35,355 width=18) (actual rows= loops=)

  • Index Cond: (road_station_sensor_id = s.id)
  • Filter: (measured > (SubPlan 2))
8.          

SubPlan (forIndex Scan)

9. 0.000 0.000 ↓ 0.0

Result (cost=1.22..1.23 rows=1 width=8) (actual rows= loops=)

10.          

Initplan (forResult)

11. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..1.22 rows=1 width=8) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using sensor_value_measured on sensor_value sensv (cost=0.43..12,251.63 rows=15,666 width=8) (actual rows= loops=)

  • Index Cond: ((road_station_id = sv.road_station_id) AND (measured IS NOT NULL))
13. 0.000 0.000 ↓ 0.0

Hash (cost=397.89..397.89 rows=1,785 width=5) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on road_station rs (cost=46.58..397.89 rows=1,785 width=5) (actual rows= loops=)

  • Recheck Cond: (type = '1'::numeric)
  • Filter: publishable
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on road_station_search_i (cost=0.00..46.13 rows=1,785 width=0) (actual rows= loops=)

  • Index Cond: ((publishable = true) AND (type = '1'::numeric))