There is a very nice pattern to prefetch a tree of objects without having a huge join result set of mostly redundant data:
This would select blogs, their posts and comments in one go. It scales to many tables and big row counts easily because duplication is avoided entirely. It avoids any Cartesian products but requires many columns and tends to recompute parts of the query (in this example the join from blogs to posts will be included twice). Does DO4 support such a thing or do you have any plans for this? This thread was imported from our support forum. The original discussion may contain more detailed answer. |
No, DO doesn't support exactly this feature. But it offers future queries and subquery batching allowing to achieve the same goal - likely, more efficiently:
Alternative with subqueries:
|
Sorry, I just noticed that originally I answered on completely different question.
I.e. I misunderstood it.