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

Revert undesirable lateral #171

Merged
merged 3 commits into from
May 24, 2024
Merged

Revert undesirable lateral #171

merged 3 commits into from
May 24, 2024

Conversation

benwilson512
Copy link
Contributor

@benwilson512 benwilson512 commented May 16, 2024

#144 introduced an effort to ensure that when a has_many through association was queried from dataloader, the order specified in dataloader is preserved.

Unfortunately per comments on that PR, this introduced some of its own bugs, and wrapping any order by in an a lateral join had problematic performance regressions. #165 also seems related to this.

This PR reverts that change, and alters the relevant test case in Dataloader to use a many_to_many which does show the order preserving properties.

@benwilson512 benwilson512 merged commit c19fec8 into main May 24, 2024
4 checks passed
@Wigny
Copy link

Wigny commented Feb 7, 2025

Hey! We are facing a similar issue to #78 but when using our own custom Dataloader.KV source, in which it fetches all intermediary entities first and later fetches all related entities for each intermediary one. Our issue lies on our final entities are ordered as we want but when resolving the intermediary ones the ordering get lost.

I wonder if you are aware and could point which logic does Ecto perform when using many_to_many with join_through but not when using has_many with through, so we can replicate it when resolving our structs orderly...

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