# Active queries in ignition gateway

**URL:** <https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423>\
**Category:** General Discussion\
**Tags:** vision\
**Created:** [April 13, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423 "2023-04-13T16:58:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/1 "2023-04-13T16:58:12Z")

</div>

Hello team ,

I am facing issue with a query where I have disabled all the query which have a data source =IQS. But still one of the query is getting executed every 10 mnts and taking 15 mnts to execute, when I tried to search that query in vision to disable , I can’t able to find this query ,  
Please help me how to stop this query from getting executed or to disable this query

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 13, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/2 "2023-04-13T17:41:46Z")

</div>

Someone could have made something that dynamically generates the SQL in your project so searching for the query could be hard. But what if you search for the table it is doing the work on, the `FROM table` (or `INSERT INTO table` or update or whatever type of query it may be).

If it's running on a schedule of 10 minute though I would guess you either have

1. a gateway or client timer script running this
2. a scheduled script (only for newer versions of Ignition)
3. a tag change script on a tag that is probably turning true every 10th minute of the hour.

You may have a different datasource that is executing this query perhaps? In the gateway you should be able to go to Status-\>Databases, and pick your datasource, find the slow queries - should hopefully help you identify which source it is running on. If it's really taking 15 minutes it should stick out like a sore thumb (unless every query is taking that long on the db).

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 6:01pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/3 "2023-04-13T18:01:15Z")

</div>

Thanks for the reply

For adding on details , this is a select query it is taking too long to run like it’s taking around 15-18 mnts .

I tried checking it on gateway scripts but that’s not present .

This query is running under infinity QS as a data source

Where the same query is been repeadly executing and still present in the active queries section .

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 13, 2023, 6:08pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/4 "2023-04-13T18:08:29Z")

</div>

> [@Arvi\_Aru](#):
>
> I tried checking it on gateway scripts

Scripts aren't the only things that can run queries. Look for a query tag. Or search for a query binding in your UI.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 13, 2023, 6:11pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/5 "2023-04-13T18:11:10Z")

</div>

Yea easily could be and it's running periodically could have polling on.

Have you done a full project search (with everything checked off and everything included in the search) for the table that you are selecting from? Do you get any results from that? The table name at the very least should be written out somewhere. Then you can parse down your results from there.

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 6:17pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/6 "2023-04-13T18:17:07Z")

</div>

I have tried searching for the query , initially when I have doing validation I have came across 4 queries which was longest recent queries , I disabled 3 of them , these 4 are from same data source , the 4 th query can’t be find .  
I exported the tags and tried to find the 4 th query seems I can’t find that , but it is actively running in the gateway .

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 13, 2023, 6:20pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/7 "2023-04-13T18:20:45Z")

</div>

Keep the search as basic as possible, do not look for the whole query, look for the tablename it is selecting from only, for all you know parts of the query are dynamically generated by a script or expression etc and by searching for the full query, you are actually excluding it from your results.

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 6:21pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/8 "2023-04-13T18:21:27Z")

</div>

I tried searching using Find / Replace option but I couldn’t find it . Is there any other option I can use.

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 6:26pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/9 "2023-04-13T18:26:52Z")

</div>

Now I tried to search only using the table name it resulted only the 3 query tags where it should have given 4 query tags . Those 3 tags I have already disabled. It’s not resulting the 4 th query

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 13, 2023, 6:29pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/10 "2023-04-13T18:29:28Z")

</div>

As @pturmel it may not be a tag. But if the other 3 tags were in the same folder or something, seems like a good place to start looking manually.

One other option, do you know what the SELECT clause looks like? Maybe one of the column names is unique or uniquely aliased, and you can try searching for that.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 13, 2023, 6:31pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/11 "2023-04-13T18:31:35Z")

</div>

Same vein: where are you searching for the table name? What options are selected in the find replace tool?

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/12 "2023-04-13T18:35:42Z")

</div>

I am trying to search the table name using find/ replace and I have selected all the options “select all “

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 13, 2023, 6:54pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/13 "2023-04-13T18:54:01Z")

</div>

I believe that only defaults to Open Views/Open Windows like

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/125ef10237b3852432a3f11bbeb1c8f46c05d935.png)

so this is only searching 1 window I have currently open in designer.

What you want to do is click on Open Windows and select All windows. Do the same for views, templates.

---

<div class="post-metadata">

**Author:** ![Arvi\_Aru](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@Arvi\_Aru](https://forum.inductiveautomation.com/u/Arvi_Aru)\
**Post date:** [April 13, 2023, 7:53pm UTC](https://forum.inductiveautomation.com/t/active-queries-in-ignition-gateway/72423/15 "2023-04-13T19:53:53Z")

</div>

I will try to check this option with all the projects I have currently with my gateway
