# Query Performance using scripting

**URL:** <https://forum.inductiveautomation.com/t/query-performance-using-scripting/22423>\
**Category:** Ignition\
**Created:** [February 7, 2019, 5:00pm UTC](https://forum.inductiveautomation.com/t/query-performance-using-scripting/22423 "2019-02-07T17:00:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [February 7, 2019, 5:00pm UTC](https://forum.inductiveautomation.com/t/query-performance-using-scripting/22423/1 "2019-02-07T17:00:18Z")

</div>

Hey everyone, quick question,  
I basically want to know if there is a big difference between running the query the following two ways:

> 1:  
> query = "INSERT INTO orders (account\_id, product\_name) VALUES (?, ?)"  
> args=[123,"Bananas"]  
> system.db.runPrepUpdate(query, args)  
> 2:  
> system.db.runPrepUpdate("INSERT INTO orders (account\_id, product\_name) VALUES (?, ?)", [123,"Bananas"])

It's probably the correct and logical way to go with #1 since it will also keep the code clean and organized, but I figured I ask and see if someone knows if there is really a performance difference between the two especially when it comes to larger queries and larger scripts.

Thanks 🤓👍

---

<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:** [February 7, 2019, 5:12pm UTC](https://forum.inductiveautomation.com/t/query-performance-using-scripting/22423/2 "2019-02-07T17:12:59Z")

</div>

There will be essentially zero difference - go with whatever is easiest to maintain (in my opinion, separating the query and arguments).
