Use multiple result sets to handle Include statements
Currently, EF uses a flat query in order to populate navigation property values when using eager loading via the Include statement. While this is acceptable in some (perhaps many) cases, there are a lot of cases where this produces unacceptable queries, whether from a size or performance perspective.
While this performance bottleneck can be partially avoided by using LoadProperty, this is
a) less expressive and more verbose
b) potentially more expensive, as it requires a round-trip for every property on every entity
Instead, please allow us the option of having EF generate multiple SELECT statements to address each navigation property
This describes pretty much how Include() works in EF Core. It uses separate queries to materialize collections.
Felipe Fujiy Pessoto commented
Steven RC Fox commented
Absolutely agree, once you get passed maybe 3 includes, especially a collection property with another include, the sql query is horrible, and the result set is bigger than it needs to be and is full of nulls.
Multiple result sets would fix this