explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6wAe

Settings
# exclusive inclusive rows x rows loops node
1. 0.018 190.532 ↓ 5.7 51 1

Hash Left Join (cost=13,878.41..13,910.65 rows=9 width=482) (actual time=190.308..190.532 rows=51 loops=1)

  • Hash Cond: ((s.sensor_id)::text = (sh1.sensor_id)::text)
2. 0.006 0.300 ↓ 5.7 51 1

Nested Loop (cost=1.86..34.05 rows=9 width=478) (actual time=0.084..0.300 rows=51 loops=1)

3. 0.057 0.090 ↓ 5.7 51 1

Hash Join (cost=1.59..3.51 rows=9 width=49) (actual time=0.068..0.090 rows=51 loops=1)

  • Hash Cond: (smch.mch_id = ndm.ndmediachannel_id)
4. 0.015 0.015 ↓ 1.8 63 1

Seq Scan on sensormch smch (cost=0.00..1.70 rows=35 width=49) (actual time=0.006..0.015 rows=63 loops=1)

  • Filter: (NOT isdeleted)
  • Rows Removed by Filter: 7
5. 0.004 0.018 ↑ 1.0 18 1

Hash (cost=1.36..1.36 rows=18 width=8) (actual time=0.018..0.018 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
6. 0.014 0.014 ↑ 1.0 18 1

Seq Scan on ndmediachannel ndm (cost=0.00..1.36 rows=18 width=8) (actual time=0.011..0.014 rows=18 loops=1)

  • Filter: (NOT isdeleted)
  • Rows Removed by Filter: 18
7. 0.204 0.204 ↑ 1.0 1 51

Index Scan using sensor_sensor_id_pk on sensor s (cost=0.28..3.38 rows=1 width=429) (actual time=0.004..0.004 rows=1 loops=51)

  • Index Cond: ((sensor_id)::text = smch.sensor_id)
  • Filter: (NOT isdeleted)
8. 0.003 190.214 ↑ 1.0 6 1

Hash (cost=13,876.47..13,876.47 rows=6 width=35) (actual time=190.214..190.214 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
9. 0.003 190.211 ↑ 1.0 6 1

Nested Loop (cost=13,842.42..13,876.47 rows=6 width=35) (actual time=190.189..190.211 rows=6 loops=1)

10. 101.424 190.112 ↑ 1.0 4 1

HashAggregate (cost=13,842.42..13,842.46 rows=4 width=39) (actual time=190.111..190.112 rows=4 loops=1)

  • Group Key: sensorhistory.sensor_id
11. 21.101 88.688 ↑ 1.0 455,561 1

Append (cost=0.00..11,564.61 rows=455,562 width=39) (actual time=0.005..88.688 rows=455,561 loops=1)

12. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on sensorhistory (cost=0.00..0.00 rows=1 width=524) (actual time=0.000..0.000 rows=0 loops=1)

13. 67.587 67.587 ↑ 1.0 455,561 1

Seq Scan on sensorhistory_0 (cost=0.00..11,564.61 rows=455,561 width=39) (actual time=0.004..67.587 rows=455,561 loops=1)

14. 0.032 0.096 ↑ 1.5 2 4

Append (cost=0.00..8.46 rows=3 width=205) (actual time=0.023..0.024 rows=2 loops=4)

15. 0.000 0.000 ↓ 0.0 0 4

Seq Scan on sensorhistory sh1 (cost=0.00..0.00 rows=1 width=528) (actual time=0.000..0.000 rows=0 loops=4)

  • Filter: ((max(sensorhistory.actiontime)) = actiontime)
16. 0.064 0.064 ↑ 1.0 2 4

Index Scan using sensoryhistory_0_actiontime_ix on sensorhistory_0 sh1_1 (cost=0.42..8.46 rows=2 width=43) (actual time=0.015..0.016 rows=2 loops=4)

  • Index Cond: (actiontime = (max(sensorhistory.actiontime)))
Planning time : 4.443 ms
Execution time : 190.643 ms