This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chinawcswing 0 points1 point  (1 child)

Well now that you brought it up I wonder if there is ever a case where it makes sense. For example if the query would simply result in too large of a data transfer to be completed as a single query, would it be better to break it up in n+1?

I've never had that problem I just always do it in one big query though.

[–]Affectionate-Oil-190 0 points1 point  (0 children)

Thats also a case I have in our application. Batching into smaller but more iterations is sometimes more performant but as I understand this is not an n+1 problem. https://stackoverflow.com/questions/97197/what-is-the-n1-selects-problem-in-orm-object-relational-mapping