-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query: Introduce context level configuration for split query
- Add enum QuerySplittingBehavior - Add RelationalDbContextOptionsBuilder.UseQuerySplittingBehavior - Add AsSingleQuery Resolves #21355
- Loading branch information
Showing
12 changed files
with
258 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.EntityFrameworkCore | ||
{ | ||
/// <summary> | ||
/// Indicates how the related collections in a query should be loaded from database. | ||
/// </summary> | ||
public enum QuerySplittingBehavior | ||
{ | ||
/// <summary> | ||
/// <para> | ||
/// The related collections will be loaded in same database query as parent query. | ||
/// </para> | ||
/// <para> | ||
/// This behavior ensures consistency of the data returned within the constraints of the transaction mode in use. | ||
/// However, this can become very slow when the query will bring back multiple related collections. | ||
/// </para> | ||
/// </summary> | ||
SingleQuery = 0, | ||
|
||
/// <summary> | ||
/// <para> | ||
/// The related collections will be loaded in separate database queries from the parent query. | ||
/// </para> | ||
/// <para> | ||
/// This behavior can significantly improve performance, but can result in inconsistency in the results returned | ||
/// if the data changes between the two queries. 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. | ||
/// </para> | ||
/// </summary> | ||
SplitQuery | ||
} | ||
} |
Oops, something went wrong.