# Appropriate approach for better performance. SQL vs transform?

**URL:** <https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 13, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801 "2024-06-13T07:19:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raro](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@raro](https://forum.inductiveautomation.com/u/raro)\
**Post date:** [June 13, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801/1 "2024-06-13T07:19:08Z")

</div>

Hello,

I am interested in knowing which solution is more appropriate for better performance.

In a Perspective table, I have data retrieved using a named query. I want to add a button to each row of the table that will open a popup window displaying data from that specific row.

Question:  
Is it better to add a dummy column "button" to the SQL table,  
or is it better to write a script that adds a new dummy column using binding transform?

script example:

```python
def transform(self, value, quality, timestamp):
    ret = []
    for key in value.keys():
        row = dict(value[key])
        row["open"] = key
        ret.append(row)
    return ret

```

Thank you for your assistance!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 13, 2024, 7:44am UTC](https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801/2 "2024-06-13T07:44:43Z")

</div>

The SQL approach is free.  
The Script Transform approach requires loading up the Jython interpreter. It will be slower.

---

<div class="post-metadata">

**Author:** ![raro](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@raro](https://forum.inductiveautomation.com/u/raro)\
**Post date:** [June 13, 2024, 7:57am UTC](https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801/3 "2024-06-13T07:57:30Z")

</div>

Great! That's exactly what I needed to know!

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [June 13, 2024, 2:30pm UTC](https://forum.inductiveautomation.com/t/appropriate-approach-for-better-performance-sql-vs-transform/91801/4 "2024-06-13T14:30:01Z")

</div>

I'll try to give some input on a part of your post you weren't even asking about 🤷

I found that having a column with a button to launch a popup is actually not the best way to do it, in practice. If your dataset returns 1000 or so rows and you scroll quickly, you'll see the button's default state without any styling you may have added on top, and it looks pretty ugly. Also, what if the dataset grows (meaning more columns get added) and then you have to scroll to see the button column?

What I started doing instead is to have a single button that will launch the info popup and to use the Table's `selectionData` property, just like you would use `rowData` the way you're doing it now.

Something like

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/1/9122b56130c0c634f963281f5870cb9164df530c.png)
