-
Improvement
-
Resolution: Fixed
-
Normal
-
None
To find unused entities for automatic removal, there are a number of database functions (empty_artists, empty_events, empty_labels, empty_places, empty_release_groups, empty_series, empty_works) that each just execute and return one query. They are there for historical reasons, because years ago they were implemented as PL/pgSQL loops instead of simple queries.
The queries should be moved into the MBS code, where they can be auto-generated, reducing duplication and making sure that no l_X_X table is accidentally left out. The database functions can then be dropped.