# Multiple Tables on top of each other, Data Querying slowing things down

**URL:** <https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [January 7, 2019, 7:07pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719 "2019-01-07T19:07:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 7, 2019, 7:07pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/1 "2019-01-07T19:07:57Z")

</div>

I have a page with 4 tables on top of each other and a nav bar at the top to switch between them. When the page first opens it is very slow, presumably because all these tables are now querying for their data.

How can I make it so that the three hidden tables are querying in the background for information instead of holding up the program? Is this an instance for system.util.invokeLater()?

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [January 7, 2019, 7:29pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/2 "2019-01-07T19:29:35Z")

</div>

What component are you using for your ‘Nav bar’?

Typically I use either radio buttons or a drop down to assign what query to put into a power table. Instead of having multiple power tables to choose from. you might be able to do something similar depending on the component used.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 7, 2019, 7:48pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/3 "2019-01-07T19:48:12Z")

</div>

It’s done with tabs. But that’s a good idea, instead of having 4 tables that turn on and off visibilty with the tab strip, maybe just use it to switch what data the single table is viewing is what you are saying?

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [January 7, 2019, 7:50pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/4 "2019-01-07T19:50:54Z")

</div>

Yeah you might be able to do something similar with tabs.

For radio buttons, I just use the following two lines:

> data = system.db.runNamedQuery("ValveCover", {})  
> event.source.parent.getComponent('Power Table').data = data

And that will take the results and set it in the table. Unfortunately, it looks like there isn't an 'actionperformed' for tab strip, so you might need to get creative, or maybe try propertyChanged.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [January 7, 2019, 8:22pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/5 "2019-01-07T20:22:07Z")

</div>

I’m giving you the solution because I realize this is the most sensible route to go. I also noticed on this page, each table had a different set of side buttons associated with it, and they’re made to be invisible on top of each other when not selected and what not - are all these invisible GUI components slowing my project down? I figure when I switch to one table I am only going to have ONE set of buttons whos action will just be condition on what tab/radio button is selected.

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [January 7, 2019, 8:28pm UTC](https://forum.inductiveautomation.com/t/multiple-tables-on-top-of-each-other-data-querying-slowing-things-down/21719/6 "2019-01-07T20:28:09Z")

</div>

Buttons shouldn’t be doing much on their own. So I would guess that the tables and the queries are what are slowing you down the most, unless there are other transactions or queries running along side of this screen.
