SECURITY-734: Fix a performance decrease in case of a large number of policy objects