1) Every time we delete an artifact we check if it's part of a release bundle, and if so the deletion fails.
This is done by a DB query:
Indexing repo_path column in bundle_files table will improve performance.
2) When deleting a repo we currently go through all its files and check one by one whether they are part of a bundle. This is costly. The solution is to add repo_key to bundle_files and check with one query whether the repo_key exists in bundle_files table.