Best practice to retrieve data

0
Hi All,   i am working currently on a project with large amount of data and i am wondering about best retrieve method. Up untill now I only used Mendix retrieve with Xpath but wondering now about OQL retrieve if it will improve performance of my app?    Can someone explain in which cases is better to use retrieve with Xpath or OQL query?   Thank you in advance 
asked
1 answers
0

Hey Anna,

 

OQL is more efficient for complex queries than using multiple retrieves and processing results in memory. It handles joins more effectively by combining multiple entities in a single query.

OQL excels with large data sets, leveraging database-level optimizations, reducing the amount of data transferred to the Mendix runtime. It uses only the necessary fields to retrieve data, which reduces memory usage and increases performance.

Normal retrieves using XPath are simpler and more intuitive for straightforward data retrieval, where you just need to fetch objects based on basic conditions. They're easy to set up and maintain and are usually sufficient for basic CRUD operations and common data access patterns.

 

Check those questions:

- https://community.mendix.com/link/space/databases/questions/139053

- https://community.mendix.com/link/space/databases/questions/138677

 

I hope it helps,

Ricardo Pereira

answered