explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JF6

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

Merge Left Join (cost=36,951.32..37,004.16 rows=725 width=556) (actual rows= loops=)

  • Merge Cond: ((f1.f1 = s3.date) AND ((s0.name)::text = s3.name))
2. 0.000 0.000 ↓ 0.0

Sort (cost=60.37..62.18 rows=725 width=524) (actual rows= loops=)

  • Sort Key: f1.f1, s0.name
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.52..25.92 rows=725 width=524) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.51..5.92 rows=1 width=516) (actual rows= loops=)

  • Hash Cond: (s0.sensor_type_id = s2.id)
5. 0.000 0.000 ↓ 0.0

Seq Scan on sensors s0 (cost=0.00..1.29 rows=29 width=532) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash (cost=4.50..4.50 rows=1 width=16) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Seq Scan on sensor_types s2 (cost=0.00..4.50 rows=1 width=16) (actual rows= loops=)

  • Filter: ((kind)::text = 'pv'::text)
8. 0.000 0.000 ↓ 0.0

Function Scan on generate_series f1 (cost=0.00..10.00 rows=1,000 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Sort (cost=36,890.95..36,905.79 rows=5,934 width=72) (actual rows= loops=)

  • Sort Key: s3.date, s3.name
10. 0.000 0.000 ↓ 0.0

Subquery Scan on s3 (cost=36,148.17..36,519.05 rows=5,934 width=72) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=36,148.17..36,459.71 rows=5,934 width=688) (actual rows= loops=)

  • Group Key: (date_trunc('day'::text, e0."timestamp")), e0.sensor_id
12. 0.000 0.000 ↓ 0.0

Sort (cost=36,148.17..36,163.01 rows=5,934 width=688) (actual rows= loops=)

  • Sort Key: (date_trunc('day'::text, e0."timestamp")), e0.sensor_id
13. 0.000 0.000 ↓ 0.0

Hash Join (cost=5.93..33,970.26 rows=5,934 width=688) (actual rows= loops=)

  • Hash Cond: (e0.sensor_id = s1.id)
14. 0.000 0.000 ↓ 0.0

Seq Scan on events e0 (cost=0.00..32,977.56 rows=237,356 width=140) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=5.92..5.92 rows=1 width=564) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.51..5.92 rows=1 width=564) (actual rows= loops=)

  • Hash Cond: (s1.sensor_type_id = s2_1.id)
17. 0.000 0.000 ↓ 0.0

Seq Scan on sensors s1 (cost=0.00..1.29 rows=29 width=580) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=4.50..4.50 rows=1 width=16) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Seq Scan on sensor_types s2_1 (cost=0.00..4.50 rows=1 width=16) (actual rows= loops=)

  • Filter: ((kind)::text = 'pv'::text)