"Remove Unused Entities" in Aggregates

Aggregates & Queries
On our radar

We now have "Remove Unused References" (AWESOME FEATURE!!!!)... now, let's see "Remove Unused Entities" in the Aggregates! Real simple... right click the Aggregate, it inspects the chain of "what's actually used?" (same logic the compiler optimizer users) and dumps the Entities and the JOINs that are not actually used in the Aggregate to filter/display/output (in other words, the right side of any LEFT JOIN that is not filtered on, sorted on, or used on the screen/output/logic).


Created on 15 Jul 2017
Comments (7)

This could potentially change the semantics of the query.

Imagine that you have a LEFT JOIN on a many-to-many relationship. Even though you might not be using that related table, it has a function of multiplying the entities that you are using.

Leonardo -

Hmm, true! And we never want a feature that changes functionality like that unexpectedly. :(


Yap, agree with Leonardo.

Good idea but I'm afraid it would bring more damage (than help) if it can change the query behavior

Hmm... maybe flag it as a True Change warning then?


Think it would be better if not all entities where (automatically) added that has a relation to the entity you want to add in the aggagrate.

Evert -

Yes, that is probably half the annoyance that I am having! Especially when I am querying an extension table, it automatically adds the base table, which I usually don't want/need...


I'm always conscious of what tables are added into the query, but 'new' developers don't even look to it and you find so much queries with tables that are never used. And the argument: 'when it isn't used it won't be retrieved on runtime' isn't a correct answer for me.