Get rid of hidden retrieves or optimize retrieves in expressions - Mendix Forum

Get rid of hidden retrieves or optimize retrieves in expressions

22

In general, I recommend to never execute retrieves in expressions. The example below, a customer is linked 1-1 with an address. It may seem like an innocent create variable, but actually does a data retrieve over association:

 

So mainly for maintainability, but also for performance reasons I would love to see this changed in Studio Pro.

Possible solutions:

Thanks for your vote!

 

image.png

asked
2 answers

Currently if you use the same object twice in an expression, Mendix will retrieve the object twice, so that means the performance is even worse than Johan's proposal. If you want to use multiple attributes in 1 expression: first retrieve the object, then create the expression based on the variable.

Created

I agree with you Johan.

 

If we use only one attribute in expressions, it is fine.

But what if when we use same entity with multiple attributes different times, then retrieving every time single attribute will definitely causes performance issues. Doesn't it?

Created