3 ms·
If you actually have to reckon with the SQL queries in your app, N+1 becomes less likely. Consider `rows.map { row -> repository.fetchRelatedRow(row.id) }`. Th
by henryfjordan 2y ago
If you actually have to reckon with the SQL queries in your app, N+1 becomes less likely.
Consider `rows.map { row -> repository.fetchRelatedRow(row.id) }`. That's much more obviously going to cause issues than `rows.map { row.relatedRow }`. You don't need to cross-reference the model code for row to see if relatedRow is eager loaded or not, the answer is right there for you.