# Named Query Performance

**URL:** <https://forum.inductiveautomation.com/t/named-query-performance/44902>\
**Category:** Ignition\
**Created:** [March 25, 2021, 12:35pm UTC](https://forum.inductiveautomation.com/t/named-query-performance/44902 "2021-03-25T12:35:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [March 25, 2021, 12:35pm UTC](https://forum.inductiveautomation.com/t/named-query-performance/44902/1 "2021-03-25T12:35:29Z")

</div>

Ignition 8.1.0

Named query uses 3 parameters:  
date\_beg - DateTime  
date\_end - DateTime  
location\_id - Int8

The query was originally:

```auto
SELECT several columns
FROM table
INNER JOIN another_table ON columns
WHERE enter_date <= :date_end
   AND exit_date >= :date_beg
   AND location_id = :location_id

```

and took 7+ seconds to execute in the designer, but less than 0.5 seconds in SSMS. I did change the dates and location for comparison purposes and tested by running in SSMS first to eliminated cached query plans as the source of the difference.

Changing location\_id from a Value/Int8 to a Query String appears to have fixed the performance issue.

Any insight into this would be greatly appreciated?

Thanks,  
Mack

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [March 25, 2021, 9:38pm UTC](https://forum.inductiveautomation.com/t/named-query-performance/44902/2 "2021-03-25T21:38:59Z")

</div>

Surely someone has some idea. Anything?

Mack
