ceph / chacra

A binary/file REST API to aid in multi-distro|arch|release management
9 stars 18 forks source link

optimize queries in models.Project #228

Closed andrewschoen closed 7 years ago

andrewschoen commented 7 years ago

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

andrewschoen commented 7 years ago

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.