Adding the implicit tenant filter to credentials search (#348, #362) has negative performance impact because tenant and role assignments are loaded into memory. This can even crash the service container.
The filters may not be combined correctly - filtering by tenant blocks filtering by username.
Solution
[ ] Do not load large bulks of data (tenant and role assignments) into memory.
[ ] Make sure the filters properly combine (AND operation) and do not block each other.
[ ] Use function composition (e.g. iterator = tenant_filter(role_filter(iterate_credentials(match_string)))) or some chunking.
Issue
Solution
iterator = tenant_filter(role_filter(iterate_credentials(match_string)))
) or some chunking.