Perf: dedicated call to count authorized/unauthorized machines
The implementation introduced in !267 (merged) to get a list of unauthorized machines is pretty inefficient. It retrieves all the machines with all the configurations just to count them. We should optimize it. One way would be to have a dedicated query for simply returning the number of machines.