SQL optimazing to Appsheet apps

Please help or give me ideas.

Initially, there were tables of type Table 1

Table 1 (Price)
 Apple Orange Pear
Market 11008030
Market 21109045
Market 3 12010050

and Table 2

Table 2 (QTY)
 Apple Orange Pear
Market 1301040
Market 2501550
Market 3 602060

But much more bigger(about 20k rows and 100 column) 

It was necessary to create permanent filters, I made them through user settings.

User Settings 
MarketsMarket 1, Market 2
Types Apple, Orange
QTY50-150
Prices80-100


And reworked the table in this form.

Flat table for Appsheet
MarketTypeQTYPriceEmount 
Market 1Apple301003000
Market 1Orange1080800
Market 1Pear30401200
Market 2Apple
Market 2Orange
Market 2Pear
Market 3Apple
Market 3Orange
Market 3Pear

So it became 150k+ rows and app worked slowly. I divided the table into 3 for each market, but still the application was slow. 

Today i made a SQL-database  with the same format and 150k+ rows and app become even a little more slower. 

Is there any ideas how to optimize Google Sheets or SQL (better SQL) to work faster with appsheet.   

I have experience with apsheet only with flat tables, it would be ideal that only data that meets the requirements in user settings is uploaded to the application.

Thank you in advance

0 4 107
4 REPLIES 4

Please share your security filter expression

I want to make it public when deployed, so i don't use a security filter. 


@AleksanderM wrote:

i don't use a security filter


Then, what do you mean by "It was necessary to create permanent filters, I made them through user settings."? If that's not applied via a security filter, then it's not limiting the data being synced.

Assuming your tables are read-only, be sure to enable Server caching.

Simplification often starts by rethinking your requirements and the specifics of your dataset, then comes the next step of thinking how the data could be best modelled. Hence, it is difficult to give you an answer based on an abstraction. But consider for example that you would like to define prices based on quantity and place, you don't have to hardwire all possible cases in a table, but you can for example create a simple calculation table where you write down the rules, then calculate the price dynamically based on users input. 

Top Labels in this Space