How to reduce time duration

I have 150 users for example and 13,000 records to import from excel. After import, I will store the 13,000 records to an object then each user will iterate in the first loop to retrieve all the records (ex: brands) that it has access to. Then in the second loop it will iterate in the 13,000 records to assign association on a specific record once the brand on the record is found on the brand retrieved during the first loop. This entire process took 30 minutes to complete. What can you recommend to improve performance?
1 answers

This way you will have the application retrieve all 13000 objects from the database and store them in MBS’s (Mendix Business Server) memory. This is what makes it slow. You can prevent this by doing this 1000 records at the time. Modify the retrieve activity like this:

After the loop, delete the processed objects, go back to the start, retrieve the next 1000 and keep going until you no longer find and objects:

And then test, test and test again. Loop need attention to become bugfree.


Forgive any misinterpretations that will make my solution stupid not helpful, but you might prevent having to loop for every user separately by doing it like in my modified image.

For offloading to an asynchronous queue, you might need module Process queue, or upgrade to Mx9 and use task queue.