Hey Andreia,
Make sure to add indexes to the attributes you often search for or retrieve. Indexes help the database find data quickly without having to scan the entire table.
Simplify complex XPath queries by breaking them down into smaller parts if needed. Simpler queries are easier for the database to execute efficiently.
Avoid using non-indexed functions like contains or start-with in your XPath queries, especially on large datasets, as these can be slow and inefficient.
Use constraints to limit the number of records you retrieve. For instance, use the Limit clause to get only the records that you need
Those are just a few things that you can do optimize the retrieves.
You can also learn by doing a certain learning paths like "Advanced Domain Model Skills" - module 4.
Also check this doc: https://docs.mendix.com/refguide/community-best-practices-for-app-performance/
Best Regards,
Ricardo Pereira
Hi Andreia,
The question is a bit too broad to give you a specific answer however there is Best Practice documentation for application performance that would be a good place to start.
Community Best Practices for App Performance | Mendix Documentation
Hope this helps,
Sam
There are several things you can do to optimize a retrieve:
but the answer to your question is:
Performance testing against your (anonimized) production database under production-like circumstances.