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

Optimize save(All) operations #2975

Open
shanon84 opened this issue Nov 24, 2024 · 0 comments
Open

Optimize save(All) operations #2975

shanon84 opened this issue Nov 24, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@shanon84
Copy link

Hey there,
I have been looking into the logic to save graphs with the Neo4jTemplate. It seems like the processing is very slow if you don't have flat Nodes to save. Let's say we have something like this modelled:
Person -[:lives_at]-> Adress

If we save Persons with Adresses now, the expected operations would be (simplyfied):
bulk save all Persons
bulk save all related Adresses
bulk save Relationships between Persons and Adresses as given

(maybe even save all nodes in chunked bulkrequests and all relationships in other)

But thats not what happens (even in simple scenarios: no version property, no dynamic label, modelled own IDs):
bulk save all Persons
save each Adress on its own
save each Relationship on its own

This leads to very expensive save operations, if you save a graph with more than 2 node types involved.
I think the hole save operation should be overhauled:
pre processing to collect and prepare all nodes and relationship to save
and after knowing what to save the operation itself can happen in bulk(s)

If this is fine with you, I would start with this in some time.

Best regards

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants