Skip to content

chore: replace original GetPrebuiltWorkspaces with optimized version #18832

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

Merged
merged 3 commits into from
Jul 21, 2025

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Jul 10, 2025

Fixes coder/internal#715

Follow-up from #18717

Once we've determined the updated query is safe, remove the duplication.

@johnstcn johnstcn self-assigned this Jul 10, 2025
@github-actions github-actions bot added the stale This issue is like stale bread. label Jul 19, 2025
@johnstcn johnstcn removed the stale This issue is like stale bread. label Jul 20, 2025
@johnstcn johnstcn marked this pull request as ready for review July 20, 2025 14:39
@johnstcn
Copy link
Member Author

johnstcn commented Jul 20, 2025

  • Checked Grafana and noted no log entries highlighting differences in old vs new query.
  • Inspected both old and new queries in Google Cloud and noted same avg number of rows returned for both.

Copy link
Contributor

@ssncferreira ssncferreira left a comment

Choose a reason for hiding this comment

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

LGTM 💪
Just curious, have you observed a similar order of magnitude in performance improvement on dogfood as the one described in the previous PR?
#18717

Explain before (71.1ms): https://explain.dalibo.com/plan/9be18ab833b7a000
Explain after (9.8ms): https://explain.dalibo.com/plan/b4a94742gaha229g (EDIT: not selecting from correct CTE)
Explain after (11.2ms): https://explain.dalibo.com/plan/bea42b563ff7fbe7

@johnstcn
Copy link
Member Author

LGTM 💪 Just curious, have you observed a similar order of magnitude in performance improvement on dogfood as the one described in the previous PR? #18717

It's not as good, but still significant.

Old (7d):
Screenshot 2025-07-21 at 12 15 26

New (7d):
Screenshot 2025-07-21 at 12 15 31

@johnstcn johnstcn merged commit 198d50d into main Jul 21, 2025
34 checks passed
@johnstcn johnstcn deleted the cj/database/GetPrebuiltWorkspaces-3 branch July 21, 2025 14:31
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: GetRunningPrebuiltWorkspaces creates lots of DB load
3 participants