Skip to content

Count only side by side collections in MaxSingleQueryCollections - #44

Merged
SimonCropp merged 1 commit into
mainfrom
side-by-side-collections
Oct 28, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
side-by-side-collections

Conversation

@SimonCropp

Copy link
Copy Markdown
Owner

A single query joins every collection it loads, but only collections side by side multiply each other's rows. A collection nested in another returns a row per item of the inner one, so it is not a cartesian explosion.

MaxSingleQueryCollections now counts that way:

  • A chain of nested collections counts as one. Include(_ => _.Departments).ThenInclude(_ => _.Employees) was 2, and is now 1.
  • Collections side by side each count. Include(_ => _.Tasks).Include(_ => _.Department.Employees) is 2.
  • A collection holding several side by side counts as many as it holds.

Includes and projected collections are combined into one tree by path, so an Include under a projected collection is nested in it.

Found from a GraphQL query loading a group's users and each user's groups, which was logged as 2 collections though it returns one row per membership.

  • Existing nested expectations drop to 1, and tests are added for collections side by side, including inside a nested one and in projections
  • readme, XML docs and claude.md updated. The readme no longer says the log default matches EF's MultipleCollectionIncludeWarning
  • Version bumped to 0.8.0, since queries can now count lower than before

A single query joins every collection it loads, but only collections side
by side multiply each other's rows. A collection nested in another returns
a row per item of the inner one, so a chain of nested collections now counts
as one, and a collection holding several side by side counts as many as it
holds.

Bump to 0.8.0.
@SimonCropp SimonCropp added this to the 0.8.0 milestone Oct 28, 2026
@SimonCropp
SimonCropp merged commit bf40525 into main Oct 28, 2026
4 checks passed
@SimonCropp
SimonCropp deleted the side-by-side-collections branch October 28, 2026 10:15
@SimonCropp
SimonCropp restored the side-by-side-collections branch October 28, 2026 10:16

This branch was successfully deployed

1 active deployment
nuget — c1baa0d8 Deployed Oct 28, 2026 by SimonCropp via publish #72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant