explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kUev

Settings
# exclusive inclusive rows x rows loops node
1. 0.035 587.680 ↓ 9.0 135 1

Hash Left Join (cost=156,327.42..160,560.32 rows=15 width=96) (actual time=586.713..587.680 rows=135 loops=1)

  • Hash Cond: (ndalarmhistory_v2.ndalarm_id = fn_ndalarmhistory.prmndalarmid)
2. 0.007 586.195 ↓ 45.0 135 1

Nested Loop (cost=156,304.67..160,537.04 rows=3 width=64) (actual time=585.254..586.195 rows=135 loops=1)

3. 197.191 585.243 ↑ 3.7 135 1

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

  • Group Key: ndalarmhistory_v2_1.ndalarm_id, ndalarmhistory_v2_1.action
4. 42.350 388.052 ↑ 1.0 1,225,368 1

Append (cost=0.00..146,911.49 rows=1,252,424 width=20) (actual time=131.198..388.052 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. 224.406 345.701 ↑ 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=131.196..345.701 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. 121.295 121.295 ↑ 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=121.295..121.295 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.540 0.945 ↑ 2.0 1 135

Append (cost=0.00..8.42 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) AND (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[])))
10. 0.405 0.405 ↑ 1.0 1 135

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

  • Index Cond: (actiontime = (max(ndalarmhistory_v2_1.actiontime)))
  • Filter: ((ndalarmhistory_v2_1.action = action) AND (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[])))
11. 0.011 1.450 ↑ 10.0 100 1

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

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

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

Planning time : 0.674 ms
Execution time : 588.324 ms