# How to reduce the Clear and Acked items in the Alarm Query of the gateway?

**URL:** <https://forum.inductiveautomation.com/t/how-to-reduce-the-clear-and-acked-items-in-the-alarm-query-of-the-gateway/79271>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 18, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/how-to-reduce-the-clear-and-acked-items-in-the-alarm-query-of-the-gateway/79271 "2023-09-18T07:30:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Chen1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Scott\_Chen1](https://forum.inductiveautomation.com/u/Scott_Chen1)\
**Post date:** [September 18, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/how-to-reduce-the-clear-and-acked-items-in-the-alarm-query-of-the-gateway/79271/1 "2023-09-18T07:30:57Z")

</div>

Hi  
As the title, does the gateway server get slow when the Alarm Query keeps going up?  
How to reduce it?

Thanks,

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/359746b8d7de60477ee809fcf6c8b7fdac6e2abc.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [September 23, 2023, 2:32am UTC](https://forum.inductiveautomation.com/t/how-to-reduce-the-clear-and-acked-items-in-the-alarm-query-of-the-gateway/79271/2 "2023-09-23T02:32:25Z")

</div>

You can filter those out of your query using the state value:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/61666b50f12a62dcad53c948838669da0f0841bf.png)

Another strategy that is commonly used to prevent the gui from slowing down with such queries is to [invoke the query asynchronously](https://docs.inductiveautomation.com/display/DOC81/system.util.invokeAsynchronous), but if you want to use the data in the gui after you have retrieved it in this way, you will need to use [system.util.invokeLater](https://docs.inductiveautomation.com/display/DOC81/system.util.invokeLater) to safely return the information to the event dispatch thread.

---

<div class="post-metadata">

**Author:** ![Scott\_Chen1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Scott\_Chen1](https://forum.inductiveautomation.com/u/Scott_Chen1)\
**Post date:** [September 26, 2023, 12:57am UTC](https://forum.inductiveautomation.com/t/how-to-reduce-the-clear-and-acked-items-in-the-alarm-query-of-the-gateway/79271/3 "2023-09-26T00:57:29Z")

</div>

Hi  
Thanks so much~  
get it, this is very helpful. I will try it.
