explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HvU8

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

WindowAgg (cost=35,515.29..35,515.32 rows=1 width=76) (actual rows= loops=)

2.          

CTE h

3. 0.000 0.000 ↓ 0.0

Gather (cost=1,104.80..35,514.74 rows=11 width=96) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=104.80..34,513.64 rows=5 width=96) (actual rows= loops=)

  • Hash Cond: (ls.line_id = il.line_id)
  • Join Filter: (h_2.received_at <@ il.connected)
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=9.05..34,234.43 rows=344 width=100) (actual rows= loops=)

  • Hash Cond: (h_2.sensor_id = ls.sensor_id)
  • Join Filter: (h_2.received_at <@ ls.connected)
6. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on heartbeats h_2 (cost=0.00..28,637.62 rows=343,862 width=96) (actual rows= loops=)

  • Filter: (sensor_id IS NOT NULL)
7. 0.000 0.000 ↓ 0.0

Hash (cost=5.69..5.69 rows=269 width=24) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on line_sensors ls (cost=0.00..5.69 rows=269 width=24) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=63.59..63.59 rows=2,573 width=25) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on item_lines il (cost=0.00..63.59 rows=2,573 width=25) (actual rows= loops=)

  • Filter: ((connected_to IS NOT NULL) OR (queue_index = '0'::double precision))
11. 0.000 0.000 ↓ 0.0

Sort (cost=0.55..0.55 rows=1 width=64) (actual rows= loops=)

  • Sort Key: h.sensor_id, h.received_at DESC
12. 0.000 0.000 ↓ 0.0

Hash Join (cost=0.29..0.54 rows=1 width=64) (actual rows= loops=)

  • Hash Cond: (h.sensor_id = h0.sensor_id)
  • Join Filter: (h.id <= h0.id)
13. 0.000 0.000 ↓ 0.0

CTE Scan on h (cost=0.00..0.22 rows=11 width=64) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=0.28..0.28 rows=1 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Subquery Scan on h0 (cost=0.26..0.28 rows=1 width=8) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Unique (cost=0.26..0.27 rows=1 width=16) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Sort (cost=0.26..0.26 rows=1 width=16) (actual rows= loops=)

  • Sort Key: h_1.sensor_id, h_1.received_at DESC
18. 0.000 0.000 ↓ 0.0

CTE Scan on h h_1 (cost=0.00..0.25 rows=1 width=16) (actual rows= loops=)

  • Filter: (id = 826,217)