Enum QuerySplittingBehavior
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
Indicates how the related collections in a query should be loaded from database.
public enum QuerySplittingBehavior
Fields
SingleQuery = 0
The related collections will be loaded in same database query as parent query.
This behavior generally guarantees result consistency in the face of concurrent updates (but details may vary based on the database and transaction isolation level in use). However, this can cause performance issues when the query loads multiple related collections.
SplitQuery = 1
The related collections will be loaded in separate database queries from the parent query.
This behavior can significantly improve performance when the query loads multiple collections. However, since separate queries are used, this can result in inconsistent results when concurrent updates occur. Serializable or snapshot transactions can be used to mitigate this and achieve consistency with split queries, but that may bring other performance costs and behavioral difference.