Closed DimitarPetrov closed 39 minutes ago
Fair point! Actually, it is a pros and cons situation here.
In our case the tables in the chain are DB-heavy views and joining them on each query makes them pretty slow. However, with this fix in some cases, unnecessary data will reach the application which would be much slower to filter out.
Probably the best solution would be to check from the chain of parent-child relations which one is the first with some kind of filter - in this case, Organization is filtered by ID = 1 and start the joins from there.
However, I am lacking knowledge of the code to do this as a contribution.
Pull request is outdated and therefore closed
Currently, when a query for element collections of embeddable entities is created, the whole chain of joins from the root entity to the embedded entity is made.
For example if we have the following relation:
ent1->ent2->ent3->ent4->embeddableEntity
The joins that were create before for the query was:
ent1, ent2, ent3, ent4, embeddableEntity
However, the information from
ent1, ent2 and ent3
is not needed and the joins can be ommited.The joins now looks like this:
ent4, embeddableEntity