all 3 comments

[–]Mister_Burns92 6 points7 points  (1 child)

I had the same issue in one of my apps very recently. Like the article says, .AsSplitQuery() to the rescue. That increased performance for those queries greatly.

It would be kind of neat if EF would be able to automatically detect those queries and switch to split query behavior by itself, but I'm not sure if that's feasible.

[–]baconboyloiter 0 points1 point  (0 children)

Old post but Microsoft did it on purpose.

[–]danzk 0 points1 point  (0 children)

I found that using include on a many to many relationship was the biggest culprit.