# Where Named Query execution

**URL:** <https://forum.inductiveautomation.com/t/where-named-query-execution/96523>\
**Category:** General Discussion\
**Tags:** namedqueries, ignition81\
**Created:** [September 27, 2024, 1:57am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523 "2024-09-27T01:57:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_Wijaya](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Martin\_Wijaya](https://forum.inductiveautomation.com/u/Martin_Wijaya)\
**Post date:** [September 27, 2024, 1:57am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523/1 "2024-09-27T01:57:25Z")

</div>

Hi,

not sure this have been asked before.  
If we run the NamedQuery, where the execution will be process ?  
is it on the Ignition server or is on the SQL server ?

Thank you

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 27, 2024, 2:03am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523/2 "2024-09-27T02:03:26Z")

</div>

Both, really.

The query is issued from the Ignition Gateway but it's the database that plans and executes the query.

---

<div class="post-metadata">

**Author:** ![Martin\_Wijaya](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Martin\_Wijaya](https://forum.inductiveautomation.com/u/Martin_Wijaya)\
**Post date:** [September 27, 2024, 2:24am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523/3 "2024-09-27T02:24:34Z")

</div>

Currently I'm trying to select data with millions of data.  
I'm trying to managed the memory allocation.

Let say I'm trying to query. the query process will be on SQL server and Ignition will received the result,  
am I correct ?

I'm trying to avoid the Ignition become slow because of bad management on the query of the data.

Thank you

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 27, 2024, 2:35am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523/4 "2024-09-27T02:35:25Z")

</div>

Yes, Ignition will receive the data, and if you query result has millions of rows it can cause issues with memory usage on the Ignition side.

---

<div class="post-metadata">

**Author:** ![Martin\_Wijaya](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Martin\_Wijaya](https://forum.inductiveautomation.com/u/Martin_Wijaya)\
**Post date:** [September 27, 2024, 5:56am UTC](https://forum.inductiveautomation.com/t/where-named-query-execution/96523/5 "2024-09-27T05:56:25Z")

</div>

Hi Kevin,

Thanks for the answer.  
Definitely will avoid to return big data or at least using paging for tables.
