We have large data in two entities - Department (600k) and DepartmentTypes (25K) and below application service method is causing performance issue. Any alternate entity supported approaches to resolve the performance issue?
Ours is a tiered application with Blazor Web Assembly as a UI framework with Entity Framework and SQL Server. • ABP Framework version: v5.3 • UI type: / Blazor Web Assembly • DB provider: EF Core • Tiered (MVC) : Yes • Identity Server Separated : yes
Reference code:
public async Task<..> GetDepartmentsWithTypeAsync()
{
var Departments = await _DepartmentRepository.GetQueryableAsync();
var DepartmentTypes = await _DepartmentTypeRepository.GetQueryableAsync();
var query = from p in Departments
join pl in DepartmentTypes on p.Id equals pl.DepartmentId
into joinGroup
from jr in joinGroup.DefaultIfEmpty()
orderby p.Id
select new
{
...
};
var DepartmentDto = (from result in query
select new Department()
{
...
}).ToList();
return DepartmentDto;
}
3 Answer(s)
-
0
hi
You can use
AsNoTracking
to improve performance.https://www.c-sharpcorner.com/UploadFile/ff2f08/entity-framework-and-asnotracking/
Change the log level to see ef logs
Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .Enrich.FromLogContext() .WriteTo.Async(c => c.File("Logs/logs.txt")) .WriteTo.Async(c => c.Console()) .CreateLogger();
-
0
Thanks, any altenate approaches for blazorise grid such as server side paging and filtering reference ABP framework implementation
-
0
I don't know yet