-
Notifications
You must be signed in to change notification settings - Fork 25
update NodeListGetRelationshipQuery to be more efficient #6387
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
Conversation
CodSpeed Performance ReportMerging #6387 will not alter performanceComparing Summary
|
backend/infrahub/core/query/node.py
Outdated
CALL { | ||
WITH n | ||
MATCH (n)<-[:IS_RELATED]-(rel:Relationship)<-[:IS_RELATED]-(peer) | ||
WHERE ($relationship_identifiers IS NULL OR rel.name in $relationship_identifiers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we differentiate the relationship_identifiers
for each direction or does it require a larger refactoring ?
we could have
relationship_identifiers_inbound
and relationship_identifiers_outbound
the idea is to have the option to only query parent and not children for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this without too much refactoring
AND all(r IN relationships(paths_bidir) WHERE (%(filters)s)) | ||
AND n.uuid <> peer.uuid | ||
RETURN n, rel, peer, r1, r2, "bidirectional" as direction | ||
CALL { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to remember that we'll need to convert this one for 1.3, maybe we can open an issue and tag all impacted PRs on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe Fatih already made this issue to go over all the CALL
subqueries before the 1.3
release. I'm not sure which issue it is though
IFC-1489
Improve performance of
NodeListGetRelationshipQuery
. here they are: