Optimizations to group/user managedby queries