Skip to content

Query: Rewrite Entity Equality #20164

Closed
Closed

Description

@smitpatel

The pattern of wrapping and unwrapping is just too leaky. Way too many expressions I encountered where it leaves behind internal states causing translation failures.
Either merge into nav rewrite since it has entity info or convert to a proper reducingEV pattern.

Activity

  1. maumar commented on Mar 4, 2020

    @maumar
    Contributor

    +1 for merge with nav rewrite

  2. roji commented on Mar 4, 2020

    @roji
    Member

    I think there's value in leaving this as a separate visitor, just to keep nav rewrite from becoming a super huge single visitor that does everything... (that doesn't mean there isn't room for cleanup/improvement in EE, possibly even a rewrite). Just something to consider.

  3. AndriySvyryd commented on Mar 5, 2020

    @AndriySvyryd
    Member

    We can keep the visitors separate in source code and combine them using a composite visitor.

  4. self-assigned this
    on Mar 6, 2020
  5. added this to the 5.0.0 milestone on Mar 6, 2020
  6. 4 remaining items

  7. added a commit that references this issue on Mar 28, 2020
    904a105
  8. smitpatel commented on Mar 28, 2020

    @smitpatel
    ContributorAuthor

    Historically, we did order by entity to order by entity PK in translation phase. It is in EE right now, which can be moved again. The reason for EE happening before nav expansion was 2 fold

    • entity.Principal == null can be replaced with entity.ForeignKey == null saving additional join. We currently don't do this as it had issues with query filter where we would give wrong results.
    • et1.Owned == et2.owned should become et1 == et2, (same for collections), they would match only if principal is same entity instance. We do it for collection at present but not for owned entities.

    In entity equality rewrite issue, we had various opinions about merging EE into navigation expansion. One more issue was about EE on a subquery with composite PK which has a contains based different translation.

    Overall design I am proposing is

    • Nav expansion which already deals with navigations does task of pruning navigations which does not need to be expanded
    • entity equality goes away from preprocessing.
    • Translation pipeline based on whatever mapping converts entity equality best it can do on server side.
  9. added a commit that references this issue on Mar 31, 2020
    b7360ca
  10. added a commit that references this issue on Mar 31, 2020
    bb88898
  11. modified the milestones: 5.0.0, on Mar 31, 2020
  12. modified the milestones: , 5.0.0 on Apr 1, 2020
  13. modified the milestones: 5.0.0, on Apr 20, 2020
  14. modified the milestones: , 5.0.0 on Nov 7, 2020
  15. 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

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions