How harmful is doing this in terms of performance
Assuming my user base reaches 20k.
I think the intersect with
operator is all client side so assuming your searches don’t have any constraints to lower that 20K to something less, it will probably need to download the entire 20K list on the client side.
If you’re interested in possibly a better to structure the data to search quicker, mind sharing what all the intersections are for?
It also looks like a ton of :each items nested searches. I’m not saying it will be any faster but have you used the advanced filter at all? That might be a cleaner way to search (although still client side)
Basically I need to filter users who have records in other DB tables… I’ve tried using :Filtered but the search is very slow
I might be wrong about the :intersect with being client side so that might explain why your way is faster…
Performance will be terrible. Bubble will download the entire results of each individual search to the page, then do the intersects there.
Advanced filter will load what it needs to the page in order to fill the RG container. With large datasets, performance is bad, but not as bad as intersect with.
Both of the above are made worse by the fact that Bubble will download every field from a record (unless the field is blocked by privacy rules).
I did some experiments with this stuff. See the below post.
Okay so it sounds like pretty much any operator is client-side? It’s just the search constraints that are server side?
Yes ! Looks of it, the only intervention we can do to not do the client-side download is to restrict
I believe merged with is server side. But I suspect if you put a sort operator on it, then it will be client side.
As you say, stuff in the “search for” box is server side. Except if you nest a search in the search for box, the nested search results are downloaded in full client side.
Regarding regular “filtered” (not advanced filters), I suspect most of that stuff is client side. Only way to know for sure is use the network tab in chrome and actually check what’s being downloaded to the page.
There’s also a method where you build a client side search as a backend workflow, then call those search results via an API. However I haven’t tried this, and so I don’t know the extent of the performance improvement, whether it torpedoes capacity, and/or problems with this approach.
If you can live with Bubble’s constraints in the “search for” box, searches will be fast, even on huge datasets.
Hi! Just want to clarify by what you are referring to when you say advanced filters? Aren’t all advanced filters attached to the :filtered operator?
Are you referring to Search Constraints?
Yep, advanced filters are a set of filters you can access within :filtered, and they are always client side.
By the “search for” box I’m referring to the below.