RE: SearchResourceAvailabilityForRequirementGroup is too slow
I don't think this is the issue.
We get good response times from the API once it has been used for a bit. But if it is cold the first 2 or 3 requests take a long time.
Looking in app insights I can see this behavior:
- The API is called after some period of inactivity.
- A workflow is retrieved. Here there's a considerable gap in execution of around 5 secs! From reading about Actions, they are executed as real time workflows. But in this case it looks like it is not real-time at all.
- There's another gap in between the msdyn_schedulingparameter call and the webrsource one. 3 secs..
- The gaps become smaller as the API is used. Here, maybe something is raising the priority of the associated workflow? or SQL is also caching the plans and data for the API...Not sure.

Also, we have noticed that the API slows down if we are creating bookable resource bookings ( which is why I was asking about NOLOCK clause in another thread ).