Skip to content

Reorder statements so the order is better suitable for batch operations #1155

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

Closed
schauder opened this issue Feb 3, 2022 · 2 comments
Closed

Comments

@schauder
Copy link
Contributor

schauder commented Feb 3, 2022

For an Aggregate Root A with a collections of B entities which in turn has a collection of C entities, insert operations are are structured like this:

  1. insert A
  2. insert 1. B
  3. insert 1. C of 1.B
  4. insert 2. C of 1.B
    ...
  5. insert 1. B
  6. insert 1. C of 2.B
  7. insert 2. C of 2.B
    ...

This is not well suited for batch operations.
For those we should execute the statements in the following order:

  1. insert A
  2. insert 1. B
  3. insert 1. B
    ...
  4. insert 1. C of 1.B
  5. insert 2. C of 1.B
  6. insert 1. C of 2.B
  7. insert 2. C of 2.B
    ...

See also #537

@ctailor2
Copy link
Contributor

ctailor2 commented Feb 4, 2022

Insert statements for entities with nested collections already appear to be ordered as desired. See this passing test I added on a branch to verify that this is the case.

@schauder
Copy link
Contributor Author

schauder commented Feb 7, 2022

Thanks.

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

No branches or pull requests

2 participants