I checked resolving roles and added another little improvement to call batch select for incompatible roles per one directly assigned role:
https://github.com/bcvsolutions/CzechIdMng/commit/8820fa548675bab8ea772ff3522b8349f2b1b6c9
Together with improvement, which I've made recently together with role request detail optimization here:
https://github.com/bcvsolutions/CzechIdMng/commit/f02b6af4b3ad3f317b54397e85a0fc0d0f403992
now check for incompatible roles takes 0,4s instead previous 3s on request with 1000 concepts locally on PostgreSql.
Test is created - its possible to use on different environments (local MS Sql tested with the same numbers as PostgreSql).
Could you do a feedback, please?
Note: Now it's obvious, when database has high latency on some environment, then any additional select can slow whole app rapidly. We need to focus to reduce selects in all places and use embedded objects in dtos, @Formula, fetch mode in entities, cache etc.