Forest snippet causing memory issue and 503 error (service not available)

Hey guys,

I’ve been using this snippet to allow scope filtering on a smart field (here), but this snippet isn’t production ready for large table with thousands of records.
The instance ends up getting memory issue and causes downtime because the where clause generated is similar to this:

WHERE IN(id, ...nTimes)

So if you have 100k record, your IN clause will have 100k members…

You should probably warn users that this snippet is ok for small tables :wink:

Cheers

Hello @Simon_BRAMI1,

Thanks for your message! :raised_hands:

That’s a great feedback, thanks.
On your side, did you find a way to fix this issue?

I ended up using the default field in my model. This field is a uuid in the DB, so in order to make the Scope working, I have to interprete it as a String. But this break the search bar as when you search on forest, it tries to lower(field) which does not work with uuids.
So I have to prevent search on this field by using searchFields, which is not very convenient when you have multiple dashbord with multiple purpose that need to search this particular field.

The ideal would be that forest allow Scoping on UUIDs with currentUser.tag :slight_smile:

That’s right.

I’m pushing a product request in our roadmap so that we can support the scoping on uuid in the future.

Thanks again for the feedback :raised_hands:

Thank you guys! Please let me know when it’s completed, this feature is very much needed on our end since we use uuids a lot :raised_hands:

1 Like