# Which approach to follow - Tag Historian /Transaction Groups/Tag Event Script and Query Tag/Named Query

**URL:** <https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535>\
**Category:** General Discussion\
**Created:** [December 30, 2021, 5:31am UTC](https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535 "2021-12-30T05:31:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharmila.belvalkar](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sharmila.belvalkar/32/30067_2.png) [@sharmila.belvalkar](https://forum.inductiveautomation.com/u/sharmila.belvalkar)\
**Post date:** [December 30, 2021, 5:31am UTC](https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535/1 "2021-12-30T05:31:02Z")

</div>

Can someone provide guidelines to decide which approach to follow in which case?

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [December 30, 2021, 5:34am UTC](https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535/2 "2021-12-30T05:34:04Z")

</div>

Each one is for different purpose, depends on what you want to do!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 30, 2021, 1:56pm UTC](https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535/3 "2021-12-30T13:56:12Z")

</div>

There's no general rule. Tell us what you are trying to do. But these links might help:

> [@SQL Tall/Long vs Wide Table Structure](https://forum.inductiveautomation.com/t/sql-tall-long-vs-wide-table-structure/26231):
>
> I am in the process of trying to collect high speed historical data to an MSSQL database. We would like to collect data to set up a predictive maintenance system. We would like to collect information like temperature, vibration, voltage, current, etc. on CNC machines on a per machine cycle/part cycle basis at a 100mS sample rate. We would then like to compare the charts based on machine/part cycle to set thresholds and detect abnormalities before they become breakdowns. We are collecting all…

> [@Organizing SQL tables and named queries efficiently](https://forum.inductiveautomation.com/t/organizing-sql-tables-and-named-queries-efficiently/53212):
>
> If you have a bunch of machines, and multiple events to track, is it best to have a transaction group for each event type, and for each machine? I read one guy say if you had a bunch of machines, you wanted to organize all of them into one table. I thought the limitations on SQL were that as a table gets bigger, the queries slow down. So I thought that if my tables are split up, then my tables will be smaller with the same total growth.

> [@Second guessing architecture](https://forum.inductiveautomation.com/t/second-guessing-architecture/50564):
>
> I’m currently writing maintenance documentation for what is officially my first Ignition deployment in the wild. The system is a data concentrator that monitors multiple identical machines and writes a consistent set of data to two different DB tables - one table has one row per machine and is updated in real time with various state values. The second table archives other data on the completion of that machines current instruction, and has one row per instruction. There is no UI on this proj…

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [December 30, 2021, 2:22pm UTC](https://forum.inductiveautomation.com/t/which-approach-to-follow-tag-historian-transaction-groups-tag-event-script-and-query-tag-named-query/54535/4 "2021-12-30T14:22:52Z")

</div>

I am new, but as a general rule for myself:

**Data Collection from Machines**  
I find that the work to create the transaction groups creates a very uniform and standard approach that results in clean and organized data. It has been great for data that is automated from machines.

I saw a person using the python updating for this, and it seemed like they were extremely picky which tags on which machines, and it got rather complex quickly I thought. Their data is very accurate, but in doing so I thought that they avoided using a standard method that would then force/encourage standards on the plc programs in the machines.

**Any manual entry data, interface buttons, tricky customization**  
When I have people doing some manual entry, I like the runprepupdate system function in python scripting. This is the case even if most the data is automated.

This has been useful in cases where I wanted to use subsets of table to delete rows as well, like if a user clicks on a row and then presses delete, the query is easy to run as a script.

In some cases I think that there are more complex things that you can do easier with the scripting. I think it is a tradeoff though between standardizing the plcs or doing this custom scripting for me. Some customization of the tables, like coloring cells, I think is done in the scripting.

**Ad Hoc Trends, Power Chart, exchange visualization**  
I have many historized tags specifically for use with the data visualization resources on the exchange.  
The historizing creates for me a uniform tabulation of the data that then works great with these premade resources.
