Limiting number of columns in aggregate

I have a table with columns [id], [Foreign Key] and [binary data]. I want to check if a record for a certain Foreign Key exists, but I don't need the binary data in this instance.

Is it possible to only select the [id] and [foreign key] columns, and not fetch the binary data in an aggregate? This would raise the performance significantly.

Hi rob knipscheer,

one of the best practices is Create an Entity only for the binary, so you can match with the ID...
So at your aggregate you only fecth the id not the binary.

Best Regards,

Pedro Vila Nova


Hi rob,

Just like Pedro wrote, you can optimize your data model.

In the model that you have, you can use an SQL with the SELECT with the fields that you want, create a structure with that fields and use it as output.

But, the best practice is like Pedro wrote. you gain in performance and you can use aggregates (that are optimized by the platform) to get the correct data that you want.




Thank you for the replies, I will use an SQL as this is the only place this is needed.

Hi rob,

Open the aggregate, and each column have some list of option avaliable, you need to select Group by "Columnname",

after you select group by it will show as selected with blue and all other with grey, so only blue columns are exposed through aggregates.

so you can choose as many columns you want, if you want you can also rename the grouped column.

Hope this helps,