Rewrite queries in dominate
This adds a new single SQL query to dominate to find all orphaned packages. In the first step it is only uses for logging purposes and does not actually contribute to the result.
This mainly fixes several problems with the original set of queries used:
- It is 10-20 times faster as the original implementation.
- It can run in no-op mode (the old implementation requires changes from one step to do the next).
- It does not longer remove arch:all package prematurely.
Edited by Bastian Blank