Get Entity Action - Single Attribute

Get Entity Action - Single Attribute

  

Hello guys

If I use the Get Entity Action this way GetHOME(HomeId).HOME.Altitude which of the following sql queries are executed in db?

 - select Altitude from HOME (only returns the selected value)

 - select Altitude from ( select * from HOME ) aux (returns the full record and then returns the selected attribute)

Thank you

Hi Ruben,

I think OutSystems has been designed to consider performance in mind.

regards,

A

Hi,

The Outsystems compiler optimize the querys in a way that only fetch the values being used. So in that case "select Altitude from HOME" should be the query that is executed in db.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi,

The Outsystems compiler optimize the querys in a way that only fetch the values being used. So in that case "select Altitude from HOME" should be the query that is executed in db.

Regards,

Marcelo


Hello Marcelo,

Does that optimization occurs only in Preparation or does also occur in Actions? I'm using the Get Entity in a general action.

Thanks

Solution

Hi,

The optimization is framework wide and not only on specific places.

Regards,

Marcelo

Solution

Hi Ruben,

This optimization can only work in Preparation and not working in actions that`s why outsystems prefers agregates in Preparation.


Regards

-SK-