-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[gitpod-db] Don't consider garbage-collected prebuilds as potential bases for incremental prebuilds #9121
Conversation
e212bb2
to
87f8858
Compare
@@ -754,6 +754,7 @@ export abstract class AbstractTypeORMWorkspaceDBImpl implements WorkspaceDB { | |||
query = query.orderBy("pws.creationTime", "DESC"); | |||
query = query.innerJoinAndMapOne("pws.workspace", DBWorkspace, "ws", "pws.buildWorkspaceId = ws.id"); | |||
query = query.andWhere("ws.deleted = false"); | |||
query = query.andWhere("ws.contentDeletedTime = ''"); |
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.
Will try this in prod (offline) to get a feeling for cardinality...
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.
Currently trying this in prod-failover with the official GitLab repo (with and without the fix). Will add findings to the PR description.
EDIT: See examples in PR description
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.
Reduced cardinality from 16919 to 337. 💪
@jankeromnes Thx for tackling this! One small nit: Could you add a comment to this line about the reasoning behind cardinality? That would be golden! |
…ases for incremental prebuilds
87f8858
to
d7939b2
Compare
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.
Thx!
Description
Don't consider garbage-collected prebuilds as potential bases for incremental prebuilds.
Related Issue(s)
Fixes high cardinality on frequently-run SQL queries.
For example, for the Gitpod repository,
For the official GitLab repository,
How to test
Release Notes
Documentation