Skip to content

Fixed N+1 problems for all toOne relationships #1241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 29, 2020
Merged

Conversation

aklish
Copy link
Member

@aklish aklish commented Mar 29, 2020

Description

toOne relationships were only join fetched if they were OneToOne and not the owning side of the relationship. This fix relaxes the constraint so all toOne joins are join fetched.

Motivation and Context

Solves N+1 problem.

How Has This Been Tested?

Verified all existing tests pass.

Verified N+1 problem for ManyToOne and OneToOne (not mapped) is removed (manually be inspecting logs).

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@aklish aklish requested a review from wcekan March 29, 2020 01:56
@coveralls
Copy link
Collaborator

coveralls commented Mar 29, 2020

Coverage Status

Coverage increased (+0.03%) to 80.08% when pulling 6e49a51 on JoinFetchManyToOne into 57bd29c on master.

@aklish aklish requested a review from jkusa March 29, 2020 14:14

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@aklish aklish merged commit cfad3ff into master Mar 29, 2020
@aklish aklish deleted the JoinFetchManyToOne branch March 29, 2020 15:29
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.

None yet

3 participants