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

Fix query response time when the number of historical value for a given attribute is large #5344

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

dgarros
Copy link
Collaborator

@dgarros dgarros commented Dec 31, 2024

No description provided.

@dgarros dgarros added the type/bug Something isn't working as expected label Dec 31, 2024
@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Dec 31, 2024
Copy link

codspeed-hq bot commented Dec 31, 2024

CodSpeed Performance Report

Merging #5344 will not alter performance

Comparing dga-20241231-fix-node-get (ca6ea28) with stable (8e63a5e)

Summary

✅ 10 untouched benchmarks

@dgarros dgarros requested a review from a team December 31, 2024 17:17
@dgarros dgarros marked this pull request as ready for review December 31, 2024 17:17
@@ -454,7 +454,8 @@ async def query_init(self, db: InfrahubDatabase, **kwargs) -> None:
WITH n1 as n, r1, a1 as a
WHERE r1.status = "active"
WITH n, r1, a
MATCH (a)-[:HAS_VALUE]-(av:AttributeValue)
MATCH (a)-[r:HAS_VALUE]-(av:AttributeValue)
WHERE %(branch_filter)s
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the filter, if the number of historical values is important for a given node the number of subquery could be very significant which would slow down the query

@dgarros dgarros merged commit b3fa9b0 into stable Jan 1, 2025
34 checks passed
@dgarros dgarros deleted the dga-20241231-fix-node-get branch January 1, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants