-
Notifications
You must be signed in to change notification settings - Fork 8
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: GetActiveDeployments fix #2654
Conversation
a8a8b33
to
9f95a9d
Compare
@@ -123,8 +123,8 @@ ORDER BY r.key; | |||
SELECT sqlc.embed(d), m.name AS module_name, m.language, COUNT(r.id) AS replicas | |||
FROM deployments d | |||
JOIN modules m ON d.module_id = m.id | |||
LEFT JOIN runners r ON d.id = r.deployment_id | |||
WHERE min_replicas > 0 AND r.state = 'assigned' | |||
LEFT JOIN runners r ON d.id = r.deployment_id AND r.state = 'assigned' |
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.
nice pre-join filtering performance improvement!
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.
It changes the query behaviour. If you have an 'idle' runner with the current query it will join the deployment, then get filtered out in the where clause. Filtering it here means that it just won't join, so the runner count will be zero but you still see the deployment row.
9f95a9d
to
6d62bdf
Compare
6d62bdf
to
181505f
Compare
No description provided.