# Consolidate Query Tags: Gateway Timer + Tag Write or Query Tag with Indexed Expression?

**URL:** <https://forum.inductiveautomation.com/t/consolidate-query-tags-gateway-timer-tag-write-or-query-tag-with-indexed-expression/55041>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [January 14, 2022, 7:40pm UTC](https://forum.inductiveautomation.com/t/consolidate-query-tags-gateway-timer-tag-write-or-query-tag-with-indexed-expression/55041 "2022-01-14T19:40:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 14, 2022, 7:40pm UTC](https://forum.inductiveautomation.com/t/consolidate-query-tags-gateway-timer-tag-write-or-query-tag-with-indexed-expression/55041/1 "2022-01-14T19:40:24Z")

</div>

I’m trying to consolidate several query tags that I’ve found I wrote in somewhat ignorance. Several tags are selecting individual fields from a common db table.

My question is, would it be better to run a gateway timer script to run a query and then delegate tag writes to the individual tags…or write a query tag that selects all the needed info, then use an expression tag to index out the individual fields?

---

<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:** [January 14, 2022, 7:48pm UTC](https://forum.inductiveautomation.com/t/consolidate-query-tags-gateway-timer-tag-write-or-query-tag-with-indexed-expression/55041/2 "2022-01-14T19:48:03Z")

</div>

I would use expression tags. Makes it obvious that the user shouldn’t write to them. Although I generally don’t bother if using Vision–the client can extract from the dataset without burdening the gateway.
