You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EF 9 is much slower in our project on queries that results in a large/complex data-model.
When returning 2700 records in the example below the operation takes more than double the time in EF 9 compared to EF 8:
2.8 sec vs. 1.2 sec
With more returned records this difference also gets exponentially worse.
The generated Sql-query (using split query) itself is not slower (has checked with SQL Profiler), it seems that the ToListAsync-operation is much slower than in EF 8?!
We have now reverted to use EF 8 with .NET 9, but are hoping you can fix this in upcoming EF-patches!
File a bug
EF 9 is much slower in our project on queries that results in a large/complex data-model.
When returning 2700 records in the example below the operation takes more than double the time in EF 9 compared to EF 8:
2.8 sec vs. 1.2 sec
With more returned records this difference also gets exponentially worse.
The generated Sql-query (using split query) itself is not slower (has checked with SQL Profiler), it seems that the ToListAsync-operation is much slower than in EF 8?!
We have now reverted to use EF 8 with .NET 9, but are hoping you can fix this in upcoming EF-patches!
Include your code
var drivningsenheter = await _context.Drivningsenheter
.Include(d => d.Taxeringsvolymer)
.Include(d => d.SchemalagdaDrivningar).ThenInclude(p => p.Lag)
.Include(d => d.SchemalagdaDrivningar).ThenInclude(p => p.Produktionsledare)
.Include(d => d.SchemalagdaDrivningar).ThenInclude(p => p.Produktionsomrade)
.Include(d => d.SchemalagdaDrivningar).ThenInclude(p => p.SchemalagdaVolymer).ThenInclude(p => p.DestineringSortiment).ThenInclude(s => s.ProduceratHandelssortiment)
.Include(d => d.SchemalagdaDrivningar).ThenInclude(p => p.SchemalagdaVolymer).ThenInclude(p => p.DestineringMottagningsplats).ThenInclude(s => s.Mottagningsplats)
.Include(d => d.Viapunkt).ThenInclude(v => v!.Viapunktkluster).ThenInclude(v => v!.Standarddestineringar).ThenInclude(v => v.DestineringMottagningsplats).ThenInclude(s => s.Mottagningsplats)
.Include(d => d.Viapunkt).ThenInclude(v => v!.Viapunktkluster).ThenInclude(v => v!.Standarddestineringar).ThenInclude(v => v.DestineringSortiment).ThenInclude(s => s.ProduceratHandelssortiment)
.Include(d => d.Avlaggskvantiteter).ThenInclude(a => a.Avlagg)
.Include(d => d.Flodesomrade)
.Include(d => d.Ursprung)
.Include(d => d.Huggningsform)
.Include(d => d.Terrangbarighet)
.Include(d => d.Vagbarighet)
.Include(d => d.Arstid)
.Include(d => d.Traktplaneringsmetod)
.Include(d => d.Kommentarer)
.Include(d => d.Kommun)
.Include(d => d.LokaltTeam)
.Where(d => request.Flodesomraden.Contains(d.FlodesomradeId) && !d.Fardig)
.AsNoTracking()
.ToListAsync(cancellationToken);
Include stack traces
Include verbose output
Include provider and version information
EF Core version: 9.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 9.0
Operating system:
IDE: Visual Studio 2022 17.12.2
The text was updated successfully, but these errors were encountered: