Hi,
I am having very poor performance on querying from a SL Client (using cocktail). I am in a dev environnement.
For instance, trying to retreive one entity + 3 level of navigation property (entity.Nav1.Nav2.Nav3) takes near 500ms (happened to hit 800ms) while the SQL query takes only 11ms on SQL server.
In this exemple Nav1 and Nav3 are a RelatedEntityList and Nav2 is a NavigationProperty. My tables are pretty empty (one or 2 records max)
The repository use QueryStrategy.DataSourceOnly
var entite = await _entiteRepository.FindAsync(p => p.Id == Entite_Id, cancellationToken, fetchOptions: options => options.Include(Entite.EntityPropertyNames.LinkEntiteToParam));
|
1st execution
Elapsed time : 467.0034 ms
2nd execution (same EM, same Entite_Id)
Elapsed time : 203.0475 ms
3rd execution (different EM, different Entite_Id)
Elapsed time : 216.054 ms
Removing the Include give pretty much the same result.
Question 1 : using query inversion OFF why the elapsed time double on the first query ?
question 2 : I find 200ms quite high, more specially when it return 0 entity. Are those time normal at all ?
Note: I tried on Temphire, using the sentence below, to query a non existing entity. It did cost ~150ms each time.
ActiveUnitOfWork.StaffingResources.FindAsync(p => p.Id == Guid.NewGuid(), fetchOptions: opt => opt.Include(p => p.Skills)); |