Remove a join to slightly optimize the gc query.
This commit is contained in:
parent
b979f99964
commit
91963c17a0
1 changed files with 3 additions and 4 deletions
|
@ -163,11 +163,10 @@ def garbage_collect_repo(repo, extra_candidate_set=None):
|
||||||
.where(RepositoryTag.repository == repo.id,
|
.where(RepositoryTag.repository == repo.id,
|
||||||
Candidate.id << candidates_orphans))
|
Candidate.id << candidates_orphans))
|
||||||
|
|
||||||
direct_referenced = (Candidate
|
direct_referenced = (RepositoryTag
|
||||||
.select(Candidate.id)
|
.select(RepositoryTag.image)
|
||||||
.join(RepositoryTag)
|
|
||||||
.where(RepositoryTag.repository == repo.id,
|
.where(RepositoryTag.repository == repo.id,
|
||||||
Candidate.id << candidates_orphans))
|
RepositoryTag.image << candidates_orphans))
|
||||||
|
|
||||||
referenced_candidates = (direct_referenced | ancestor_referenced)
|
referenced_candidates = (direct_referenced | ancestor_referenced)
|
||||||
|
|
||||||
|
|
Reference in a new issue