Open yueliangwen opened 5 years ago
So far there's no general support for that in domainql. I am working mostly done with a generalized query tool for automaton that goes even beyond batched resolvers in that it will generate large joined-table selects for all -to-one relations and put them together with additional joined queries for -to-many relations very much like a batched resolver does. That solution is not general though, but built for the "InteractiveQuery" based queries / the JOOQ-to-js criteria API embedded within
The current way to go beyond the naive fetchers would be to creating a view doing a better, or to create a Java-defined POJO that contains the result of multiple queries. Starting with 0.2.0 you can also define relations based on database views and general POJOs (and use the FetcherContext feature to fetch things in one-go and provide them for subsequent naive fetchers to use)
@fforw I will consider your suggestions, thanks.
Is there any guidance on how to avoid the common "n+1" problem?