- Notifications
You must be signed in to change notification settings - Fork907
fix: optimize queue position sql query#17974
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coderd/database/querier_test.go Outdated
"github.com/coder/coder/v2/coderd/provisionerdserver" | ||
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.
This should be grouped with the rest of thegithub.com/coder/coder/v2
imports. Also, thecdr.dev/slog
import should be grouped in with those as well
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.
done
@@ -80,17 +80,21 @@ pending_jobs AS ( | |||
WHERE | |||
job_status = 'pending' | |||
), | |||
online_provisioner_daemons AS ( | |||
SELECT id, tags FROM provisioner_daemons pd | |||
WHERE pd.last_seen_at IS NOT NULL AND pd.last_seen_at >= (NOW() - (@stale_interval_ms::bigint || ' ms')::interval) |
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.
This should probably be a more descriptive param likeprovisioner_daemon_stale_interval_ms
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.
We use@stale_interval_ms
everywhere - so I kept it for consistency.
110102a
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Use only
online provisioner daemons
forGetProvisionerJobsByIDsWithQueuePosition
query. It should improve performance of the query.