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

the better way to optimize graph relationship one -to - many #4992

Closed
son2408 opened this issue Dec 6, 2022 · 1 comment
Closed

the better way to optimize graph relationship one -to - many #4992

son2408 opened this issue Dec 6, 2022 · 1 comment

Comments

@son2408
Copy link

son2408 commented Dec 6, 2022

This my use case, I want return all values both null
image

I builded query with optional match but It is very slow and if number of graphs is too many then optional match will too many
match (v:A) -[e:A_B]-> (v2:B)
optional match(v2:B) -[e:B_E]-> (v3:E)
optional match(v2:B) -[e:B_F]-> (v4:F)
optional match (v:A) -[e:A_C]-> (v5:C)
return v, v2, v3, v4, v5

@wey-gu
Copy link
Contributor

wey-gu commented Dec 12, 2022

For such one to many, if you don't care about the path, you could use GO FROM 1 TO 2 STEPS …, or GET SUBGRAPH

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

3 participants