Background context
There are a number of timeout issues occurring in the appointments service which is down to the queries that get executed against the database. The issues are almost always on larger enterprise databases. It's likely we can refactor some of the queries to skip some include statements when certain query string parameters are not passed.
Specification
Project: Reapit.Services.Appointments
Review database query logic and how we build up the queryable object. Correlate includes with query string parameters and look at where some could be omitted (and the data attached later from a separate query run after the initial database call). An example here is to omit inclusion of negotiators and importantly their associated lookups if there is no negotiatorId or officeId query string parameter present in the request, which is the only reason this subset of data is included in the initial query in the first place.
Look into AsNoTracking() / AsSplitQuery() behaviour in newer versions of .NET / LINQ
Background context There are a number of timeout issues occurring in the appointments service which is down to the queries that get executed against the database. The issues are almost always on larger enterprise databases. It's likely we can refactor some of the queries to skip some include statements when certain query string parameters are not passed.
Specification