Open Closed

ABP Entity Framework multiple entities join peformance issue #4793


User avatar
0
mithun created

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;
        }

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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();
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mithun created

    Thanks, any altenate approaches for blazorise grid such as server side paging and filtering reference ABP framework implementation

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I don't know yet

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.