diff --git a/CHANGES/3969.bugfix b/CHANGES/3969.bugfix new file mode 100644 index 0000000000..c283c14070 --- /dev/null +++ b/CHANGES/3969.bugfix @@ -0,0 +1 @@ +Improved the performance when looking up content for repository versions. diff --git a/pulpcore/app/models/repository.py b/pulpcore/app/models/repository.py index 5b84532c99..a73bfaac93 100644 --- a/pulpcore/app/models/repository.py +++ b/pulpcore/app/models/repository.py @@ -707,7 +707,7 @@ def get_content(self, content_qs=None): if content_qs is None: content_qs = Content.objects - return content_qs.filter(version_memberships__in=self._content_relationships()) + return content_qs.filter(pk__in=self._content_relationships().values_list("content_id")) @property def content(self):