agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

Optimization: "relatedViaQueryWithParentIds" strategy when limit is involved #624

Closed andrus closed 1 year ago

andrus commented 1 year ago

An optimization of Cayenne RelatedDataResolver:

If the parent entity has limit, assume a "large" result and switch over to "relatedViaQueryWithParentIds" strategy for fetching children. Suppose we can utilize a threshhold here (e.g. strategy = limit > 0 && limit < 5000 ? relatedViaQueryWithParentIds : relatedViaQueryWithParentExp) .