Project

Profile

Help

« Previous | Next » 

Revision 3bfdbd84

Added by rmcgover over 2 years ago

Improve performance of remove_unit_duplicate_nevra

This function, which is used whenever a new RPM is uploaded, was slower than necessary.

The old implementation would first use find_repo_content_units, which queries for all unit IDs of the required type in the repo and then performs a unit query combining the relevant NEVRA with the IDs.

In fact finding all those unit IDs is measurably slow for a large repo, and it's much faster (while still correct) to simply search for the RPMs to remove directly. It's harmless if this finds some RPMs with same NEVRA which are already not in the repo.

On our installation, for a repo with ~24000 RPMs, this reduced the runtime of this method from ~8 seconds to <0.1 seconds.

fixes #4527 https://pulp.plan.io/issues/4527