Performance when loading Repeating Groups with search results

Hi

I’m wondering if anyone could shed some light on the following.
I was thinking that a possible way to accelerate the rendering of a complex page that has Repeating Group (RG) or dropdown (DD) elements that are loaded through a “Do a search for” possibly with many static constraints (i.e. those I know of before rendering the page) and some dynamic constraints that will be set by the user after the page is loaded.

I am assuming that if the user adds dynamic constraints through some widgets in the page (that would force an additional ‘filter by’ or a ‘sort by’ to the result seat of the search that loaded them initially) that the page would go again to the server and issue a new search to match those new dynamic constraints.

Would the following make it more efficient or Bubble’s smarts are there already and would render all this irrelevant?

  1. Do all the static searches (i.e. those with all the possible static filter and sort constraints) when the page is loaded, storing the results as states of some element in the page. Let’s say I call those states Elem1’s ResultSet1, Elem1’s ResultSet2, etc. and that I define each as a list of the things I searched for. This s/b relatively compact memory-wise, because (I think) Bubble will store there only the unique IDs of the elements in the result set.

  2. When I define the RG or the DD whose contents are based on a search, I’d then use Elem1’s ResultSet1, 2, …N as its source of data.

  3. To honour the user requests for dynamic constraints to the result sets, I’d add a :sorted or :filtered to the previous statement.

I realize that the :sort or :filter are less efficient than putting those constraints in the search but the reality is that in the first search, I don’t know what the user is going to ask for.

If there were no dynamic constraints selected by the user in the page, all I’ve done so far is to add some overhead in the assignment of data sets to the element’s state, used as an intermediate variable. If the user plays with the dynamic constraints in the page, then there might be a gain.

I also wanted to use this approach in a page that has a Tab Element where the RG is in one of the tabs. Is it correct to assume that each time the user goes back and forth to that tab, that the search is done again? If so, would the approach described above make sense?

Many thanks for your guidance!

Alex