Form Save Event with Sequence of Actions taking very long to Complete

I’m not quiet sure what is happening, but I have a sequence of actions attached to a form save event and since last week this sequence is taking in excess of 3 minutes, when before it would take about 15 seconds. The last action in the sequence is switching to a specific view, so I have been timing from the form save to when the new view shows up. I just did an example run, and after clicking ‘save’, it goes to a blank form screen of the form I just submitted and goes into freeze mode, then when it finally goes to the designated view it was about 7 minutes later. I looked at the execution log, and adding up the duration of all the actions that fired from the save event, was 1.65 seconds.

Is there something that was changed within Appsheet that is causing this? What else should I look at? All the actions executed. The action sequence essentially adds several other rows to other tables that are related to the first form entry, in my example this resulted in a total of 38 other rows being added to 3 other tables.

Hello @Markus_Malessa , that’s a long delay, and your actions are performing very well if they only took 1.65 seconds, did you talk to support about this?

1 Like

I have not yet talked to support. Was hoping that someone else might be experiencing the same. Interestingly enough, I have the same set of actions within another application and although I also noticed an increase in response time there also, it is not taking nearly as long there. I would say that last week on Monday response time was around 15 seconds, then when I checked Thursday, response time was in excess of 3 minutes.

Neither application is deployed as of yet, one running in regular browser, the other in preview. Both connect to Google Cloud SQL, one fetches less than 2% of the data compared to the other one due to security filters. The one with security filters is the one that takes longer to respond for this process and generally takes about 20 seconds to sync, the other one takes 15-25 seconds to sync. Support might be my next step depending on what I find today.

2 Likes

I should mention that I keep on getting the ‘Page Unresponsive’ popup throughout this process also. If I keep clicking on the ‘Wait’ button it keeps popping up about a dozen times.

1 Like

Even 15 seconds seems long to me. Waiting minutes is absurd!

As with most performance problems, I would expect your problem is with queries: expressions that use FILTER(), LOOKUP(), MAXROW(), MINROW(), or SELECT(). Query performance can degrade very fast, and will get worse and worse as your data set increases in size. I suspect the reason you saw the performance fall off is because your data set grew enough to reach a tipping point. The reason your other app doesn’t have the same problem is probably because it has less data.

1 Like

Hi Steve,

The problem is that the app that pulls less data is the one that takes longer on the action sequence. However, the app that pulls less data also has security filters. Do you think that the security filters could have that much effect when running an action sequence?

It’s possible. Have you looked at the performance profile?

https://help.appsheet.com/en/articles/976128-performance-profile

1 Like

Sure have, here is part of the results for a sync that took 20 seconds to complete.

I find the nested ‘read table rows’ under the WaterUseData peculiar because apparently it reads all table rows first and then applies the security filter which I’m guessing is the 1209 rows read, but the interesting thing is that there is only about 60 rows of data actually displayed within the application.

This is my security filter on the table

A security filter is applied to each row of the table, so of course every row of the table must be loaded.

Your security filter expression is potentially pretty heavy, given it has to scan all rows of two other tables for every row of this table. It’s actually worse than that, but hopefully that alone should give you something to look at.

1 Like

Certainly something to think about I suppose. So on a lot of these tables I happen to have a column that stores a string of keys for the many to many relationship, because SQL database does not allow for a list of keys to be stored for many to many relationships. I in part did this because of how Appsheet handles nested forms for creating these entries and the inability to figure out how to assign nested form entries when using the link to form formula. Would you typically advise for or against going about things in this way? I have adjusted my security filter to this:

And the resulting performance profile was this:

Which does look a little different. Total sync time for this particular instance was still 18 seconds.

1 Like

On another note I suppose, any ideas why Appsheet has to fetch all data instead of running a query (in case of SQL database) against the database directly? It would seem more efficient to only return rows from the database that match the query vs potentially returning 100s of thousands of rows and then apply a complex filter.