Performance - To Function() or not to Function()

Performance - To Function() or not to Function()

Hi everyone,

I would like to understand, performance wise, what is the best option: Entity function or Query/Aggregate?

Let's say I have an action (B) that I'm using inside another action (A). That (B) has input parameters and I define the value for those parameters using some Entity functions nested in If's. Is that, performance wise, better than inserting a Query/Aggregate before that action (B) to get their results in the Locals scope to be used for the value of action (B) input parameters?

This is just an example, I just want to understand what performs better: Entity function or Query/Aggregate?
It depends, if I use many entity functions or not... But can someone give me a better insight?

I've already read "Performance Tuning for OutSystems Applications - Technical Note" which states:
Replace Get<Entity> invocations:
- If you don't need to retrieve all Entity Attributes, consider replacing the Get<Entity> invocation by a Simple Query using an Identifier parameter. Platform Server will optimize the query to retrieve the required attributes.

Is this still valid?
Yes it is still valid. Get<Entity> actions/functions return the whole entity, meaning all attributes. Aggregates are optimized in scope, so as long as you are not using all the attributes of the entity then only the ones that you need in that scope are fetched.