# Improving Alarm Journal Query Performance

**URL:** <https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 21, 2020, 8:34pm UTC](https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919 "2020-07-21T20:34:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [July 21, 2020, 8:34pm UTC](https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919/1 "2020-07-21T20:34:57Z")

</div>

I have a script that combines both the audit event table and the alarm journal data into one table. I found that the window runs very slowly and it turns out that [system.alarm.queryJournal](https://docs.inductiveautomation.com/display/DOC80/system.alarm.queryJournal) takes 70% of the execution time for the entire script.

Has anyone found a method to improve the response time from this function? I am only trying to query a period of two hours but it takes 12-15 seconds to complete.

Thanks,  
Brandon

---

<div class="post-metadata">

**Author:** ![KMuldoon](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KMuldoon](https://forum.inductiveautomation.com/u/KMuldoon)\
**Post date:** [July 23, 2020, 4:37am UTC](https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919/2 "2020-07-23T04:37:03Z")

</div>

Is the script running on the gateway or on the client?

---

<div class="post-metadata">

**Author:** ![brandon1](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@brandon1](https://forum.inductiveautomation.com/u/brandon1)\
**Post date:** [July 23, 2020, 11:26am UTC](https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919/3 "2020-07-23T11:26:37Z")

</div>

It is running on the client.

---

<div class="post-metadata">

**Author:** ![KMuldoon](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@KMuldoon](https://forum.inductiveautomation.com/u/KMuldoon)\
**Post date:** [July 24, 2020, 2:30am UTC](https://forum.inductiveautomation.com/t/improving-alarm-journal-query-performance/36919/4 "2020-07-24T02:30:55Z")

</div>

I’d suggest moving it to the gateway to offload the heavy lifting from the client. You could put the script in a [timer script](https://docs.inductiveautomation.com/display/DOC80/Gateway+Event+Scripts#GatewayEventScripts-TimerScripts) or [message handler](https://docs.inductiveautomation.com/display/DOC80/Gateway+Event+Scripts#GatewayEventScripts-MessageScripts) and write it to a memory tag that populates the table.
