As the number of binaries increase in the chacra nodes using the
relationship setup by sqlalchemy to get a project's binaries
becomes very costly. This change avoids that and only requests
the data it needs using distinct.
I tested this with a data dump from chacra4 (which was experiencing a high load today) and it took a request to binaries/ceph from ~6 seconds to ~.7 seconds.
As the number of binaries increase in the chacra nodes using the relationship setup by sqlalchemy to get a project's binaries becomes very costly. This change avoids that and only requests the data it needs using distinct.
Signed-off-by: Andrew Schoen aschoen@redhat.com