# Need help with Query Optimization Tool

**URL:** <https://forum.inductiveautomation.com/t/need-help-with-query-optimization-tool/116959>\
**Category:** Ignition\
**Tags:** namedqueries, scripting, ignition81, perspective\
**Created:** [September 1, 2026, 12:40pm UTC](https://forum.inductiveautomation.com/t/need-help-with-query-optimization-tool/116959 "2026-09-01T12:40:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [September 2, 2026, 4:13pm UTC](https://forum.inductiveautomation.com/t/need-help-with-query-optimization-tool/116959/4 "2026-09-02T16:13:33Z")

</div>

If this is for fun and a learning project I say go for it there's a lot of things you can touch on and learn - gathering what queries are being run by ignition, parsing the logs etc. Ignition already logs slow queries and I have a script to fetch them from a while ago.

> [@Log filter for slow queries?](https://forum.inductiveautomation.com/t/log-filter-for-slow-queries/53537/8):
>
> Ok great I have it working well enough now so that I can revisit the queries and see some specifics. For anyone wondering how to do the same thing, this is a function I call from a gateway message handler: """ These scripts can ONLY be run on the gateway context. """ from com.inductiveautomation.ignition.gateway import IgnitionGateway import system.util logger = system.util.getLogger("gateway.query") LIMIT = 100 def getLongQueries(): """ Note: query.duration is a long, measuring millisec…

If this is for production I might say to not bother. Find the slow queries that Ignition logs, use your database software of choice to analyze the query and dissect from there. Theres not much more to it in my experience and I don't know what value add Ignition will do for you here outside of maybe curating slow queries into a db / email for you or a DBA on a regular basis which could admittedly be helpful.

---

_[View the full topic](https://forum.inductiveautomation.com/t/need-help-with-query-optimization-tool/116959)._
