# Performance: JS calculation in "Mother" table OR query booleans in all children tables

**URL:** https://community.glideapps.com/t/performance-js-calculation-in-mother-table-or-query-booleans-in-all-children-tables/66667
**Category:** Ask for Help
**Created:** [September 30, 2023, 5:59pm UTC](https://community.glideapps.com/t/performance-js-calculation-in-mother-table-or-query-booleans-in-all-children-tables/66667 "2023-09-30T17:59:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![burningmikey](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/burningmikey/32/49706_2.png) [@burningmikey](https://community.glideapps.com/u/burningmikey)
#### Post date: [September 30, 2023, 5:59pm UTC](https://community.glideapps.com/t/performance-js-calculation-in-mother-table-or-query-booleans-in-all-children-tables/66667/1 "2023-09-30T17:59:15Z")

</div>

Hi everyone,

I need to filter a Table0 based on computations using general variables (specific columns from the User table) in Table0 and child Table1 (mother Table0 has a multiple relation to child Table1).

For speed and scaling considerations (for at least 3/4k+ rows in each table), is it better to:

- Use a “classic” filter independently on both tables (compute a boolean on each row of the Table0 and Table1; And then from Table 0, querying relation to Table1 for related rows where boolean is true;
- Or in Table0, use a join list on the (multiple) relation to Table1 and use javascript to compare each element of that list to the general variables and return a boolean.

Same question if there are more children tables (Table2, Table 3) and more general variables (more conditions to check in all tables).

Thank you in advance for your help!

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [October 2, 2023, 12:49am UTC](https://community.glideapps.com/t/performance-js-calculation-in-mother-table-or-query-booleans-in-all-children-tables/66667/3 "2023-10-02T00:49:08Z")

</div>

Is the filter applied on both tables, or when you have filtered out table0 then you take into account all related children in table1?

---

<div class="post-metadata">

### Author: ![burningmikey](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/burningmikey/32/49706_2.png) [@burningmikey](https://community.glideapps.com/u/burningmikey)
#### Post date: [October 2, 2023, 1:03pm UTC](https://community.glideapps.com/t/performance-js-calculation-in-mother-table-or-query-booleans-in-all-children-tables/66667/4 "2023-10-02T13:03:41Z")

</div>

Overall I filter both but need to retrieve only the filters of table0:  
I have a computed boolean is\_filtered1 in table1. I pull the results in table0 (multiple relation to table1), and do a rollup (column is\_filtered0) to check that some is\_filtered1 (from related items to table0) are true.
