Skip to content
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

Improve loads by using maps for deduplication #1337

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

nicowolf91
Copy link

Let maps handle the deduplication logic to increase performance / improve response times.

Commit Deduplicate IDs in eager loads. introduced nested loops to filter duplicate foreign key IDs that are passed to the WhereIn-Function.
We noticed that the nested-loop-implementation of the deduplication logic results in bad performance as the number of eagerly loaded entities increases: #267.

We considered completely dropping the deduplication since databases treat IN clauses as sets.
The map-implementation improves performance and keeps the resulting SQL statements "backwards-compatible".

Please let us know if anything is missing!

@nicowolf91 nicowolf91 changed the title Improve loads Improve loads by using maps for deduplication Jan 2, 2024
@stephenafamo stephenafamo merged commit 74a8ec7 into volatiletech:master Jan 2, 2024
2 checks passed
@nicowolf91 nicowolf91 deleted the improve-loads branch January 4, 2024 12:58
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.

2 participants