explain.depesz.com

PostgreSQL's explain analyze made readable

Result: N6UP

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 595.850 ↓ 13.5 135 1

Hash Left Join (cost=156,327.42..160,543.27 rows=10 width=96) (actual time=594.920..595.850 rows=135 loops=1)

  • Hash Cond: (ndalarmhistory_v2.ndalarm_id = fn_ndalarmhistory.prmndalarmid)
2. 0.004 594.255 ↓ 67.5 135 1

Nested Loop (cost=156,304.67..160,520.17 rows=2 width=64) (actual time=593.350..594.255 rows=135 loops=1)

3. 205.211 593.306 ↑ 3.7 135 1

HashAggregate (cost=156,304.67..156,309.67 rows=500 width=20) (actual time=593.282..593.306 rows=135 loops=1)

  • Group Key: ndalarmhistory_v2_1.ndalarm_id, ndalarmhistory_v2_1.action
4. 45.749 388.095 ↑ 1.0 1,225,368 1

Append (cost=0.00..146,911.49 rows=1,252,424 width=20) (actual time=123.674..388.095 rows=1,225,368 loops=1)

5. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on ndalarmhistory_v2 ndalarmhistory_v2_1 (cost=0.00..0.00 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (ndalarm_id = ANY ('{12,79,10,42,90,18,59,78,98,100,63,9,24,64,55,68,84,88,38,74,6,71,29,2,72,41,7}'::bigint[]))
6. 228.893 342.345 ↑ 1.0 1,225,368 1

Bitmap Heap Scan on ndalarmhistory_v2_0 ndalarmhistory_v2_0_1 (cost=24,685.98..146,911.49 rows=1,252,423 width=20) (actual time=123.672..342.345 rows=1,225,368 loops=1)

  • Recheck Cond: (ndalarm_id = ANY ('{12,79,10,42,90,18,59,78,98,100,63,9,24,64,55,68,84,88,38,74,6,71,29,2,72,41,7}'::bigint[]))
  • Heap Blocks: exact=66932
7. 113.452 113.452 ↑ 1.0 1,225,368 1

Bitmap Index Scan on ndalarmhistory_v2_0_ndalarm_id_fkey_ix (cost=0.00..24,372.87 rows=1,252,423 width=0) (actual time=113.452..113.452 rows=1,225,368 loops=1)

  • Index Cond: (ndalarm_id = ANY ('{12,79,10,42,90,18,59,78,98,100,63,9,24,64,55,68,84,88,38,74,6,71,29,2,72,41,7}'::bigint[]))
8. 0.675 0.945 ↑ 2.0 1 135

Append (cost=0.00..8.39 rows=2 width=90) (actual time=0.007..0.007 rows=1 loops=135)

9. 0.000 0.000 ↓ 0.0 0 135

Seq Scan on ndalarmhistory_v2 (cost=0.00..0.00 rows=1 width=116) (actual time=0.000..0.000 rows=0 loops=135)

  • Filter: ((ndalarmhistory_v2_1.action = action) AND ((max(ndalarmhistory_v2_1.actiontime)) = actiontime))
10. 0.270 0.270 ↑ 1.0 1 135

Index Scan using ndalarmhistory_v2_0_actionime_ix on ndalarmhistory_v2_0 (cost=0.43..8.39 rows=1 width=64) (actual time=0.002..0.002 rows=1 loops=135)

  • Index Cond: (actiontime = (max(ndalarmhistory_v2_1.actiontime)))
  • Filter: (ndalarmhistory_v2_1.action = action)
11. 0.011 1.561 ↑ 10.0 100 1

Hash (cost=10.25..10.25 rows=1,000 width=40) (actual time=1.561..1.561 rows=100 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
12. 1.550 1.550 ↑ 10.0 100 1

Function Scan on fn_ndalarmhistory (cost=0.25..10.25 rows=1,000 width=40) (actual time=1.543..1.550 rows=100 loops=1)

Planning time : 1.168 ms
Execution time : 596.553 ms