Skip to content

Query: we shouldn't rewrite collection navigations if they are also being included #8229

Closed as duplicate

Description

@maumar

query:

ctx.Customers.Include(c => c.Orders).Select(c => new { c, c.Orders }};

This currently produces N+1 queries because the collection is being projected in the final result, however we should leverage the include pipeline for this case, as it can produce better queries (i.e. no N+1)

This should already be happening for references.

Another thing we could/should do is to use Include pipeline for collection navs projections even when the Include is not specified (again, to produce more efficient queries)

Activity

  1. self-assigned this
    on Apr 19, 2017
  2. added this to the 2.0.0 milestone on Apr 19, 2017
  3. maumar commented on Jun 3, 2017

    @maumar
    ContributorAuthor

    covered by #8584

  4. modified the milestone: 2.0.0 on Jun 9, 2017
  5. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions