# Where is the history of database queries stored on the gateway?

**URL:** <https://forum.inductiveautomation.com/t/where-is-the-history-of-database-queries-stored-on-the-gateway/107047>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 4, 2025, 7:34pm UTC](https://forum.inductiveautomation.com/t/where-is-the-history-of-database-queries-stored-on-the-gateway/107047 "2025-06-04T19:34:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![papincay](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@papincay](https://forum.inductiveautomation.com/u/papincay)\
**Post date:** [June 4, 2025, 7:34pm UTC](https://forum.inductiveautomation.com/t/where-is-the-history-of-database-queries-stored-on-the-gateway/107047/1 "2025-06-04T19:34:43Z")

</div>

![querys hist](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b9e84512893aa8faa6a9405855af2f3eb5d1aec.jpeg)  
Hi everyone.

I want to know where is stored the history of the longes recent queries in the gtw or someone default table in the database?.

Ty!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 4, 2025, 7:49pm UTC](https://forum.inductiveautomation.com/t/where-is-the-history-of-database-queries-stored-on-the-gateway/107047/2 "2025-06-04T19:49:24Z")

</div>

The set of 'expensive' queries is only tracked in memory; if you restart the gateway the list will be purged and have to start from scratch. There's no supported way to access the information in it programmatically.

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [June 4, 2025, 8:49pm UTC](https://forum.inductiveautomation.com/t/where-is-the-history-of-database-queries-stored-on-the-gateway/107047/3 "2025-06-04T20:49:38Z")

</div>

If you are using MSSQL, then you could probably look into using the Query Store.
