mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Merge pull request #10175 from AlanCoding/only_have_eyes_for_you
Add more fields to .only since they get referenced SUMMARY Fixes a performance bottleneck when saving playbook_on_stats for jobs that use --limit against a small number of hosts while it has a large number in the inventory. ISSUE TYPE Bugfix Pull Request COMPONENT NAME API ADDITIONAL INFORMATION 'tis the problem with .only(), that only the developer who wrote the queryset remembers that the other fields cannot be referenced except at the cost of another query https://github.com/ansible/awx/pull/7352/files Reviewed-by: Chris Meyers <None> Reviewed-by: Alan Rominger <arominge@redhat.com>
This commit is contained in:
commit
d477f04d75
@ -511,7 +511,7 @@ class JobEvent(BasePlaybookEvent):
|
||||
|
||||
from awx.main.models import Host, JobHostSummary # circular import
|
||||
|
||||
all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id')
|
||||
all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name')
|
||||
existing_host_ids = set(h.id for h in all_hosts)
|
||||
|
||||
summaries = dict()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user