- Notifications
You must be signed in to change notification settings - Fork1.1k
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
| ), | ||
| online_provisioner_daemonsAS ( | ||
| SELECT id, tagsFROM provisioner_daemons pd | ||
| WHEREpd.last_seen_atIS NOT NULLANDpd.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 daemonsforGetProvisionerJobsByIDsWithQueuePositionquery. It should improve performance of the query.