Slow EF Core queries are rarely EF Core's fault. Most of the time it's a missing projection, an accidental N+1, or change tracking doing work nobody asked for. Log the generated SQL and measure the slow query in the database before you change anything. Then project only the columns you need, remove tracking from read-only entity queries, and fix N+1 round trips before reaching for lower-level optimizations.
This page maps EF Core performance techniques from quick wins to specialized optimizations. Start with query optimization; that's where the biggest gains hide.
Why Does EF Core Performance Matter?
EF Core performance tuning is the work of fixing the causes of slow requests: query shape, excess change tracking, and too many database round trips.
Entity Framework Core is the most popular ORM in the .NET ecosystem. It makes data access simple, but that simplicity can hide inefficient queries, excessive database round trips, and memory issues.
Without proper optimization, EF Core can become the bottleneck in your application - especially under load.
This guide collects the most impactful performance techniques, organized from quick wins to advanced strategies. It also indexes the rest of the EF Core library on this site: data modeling, access patterns, and fixes for the most common runtime errors.
Query Optimization
The biggest performance gains usually come from how you write your queries. These articles cover techniques that reduce database load and improve response times.
- How to Improve Performance with EF Core Query Splitting
- Unleash EF Core Performance with Compiled Queries
- How I Made My EF Core Query Faster with Batching
- How to Use Global Query Filters in EF Core
- DbContext Is Not Thread Safe: Parallelizing EF Core Queries the Right Way
- Common EF Core Query Performance Mistakes
- Solving the N+1 Query Problem in EF Core
- Lazy, Eager, and Explicit Loading in EF Core
- Find vs FirstOrDefault in EF Core
- AsNoTracking vs AsNoTrackingWithIdentityResolution
- Pagination in ASP.NET Core With EF Core
- How to Log SQL Queries Generated by EF Core
Choosing Your Data Access
EF Core is not the only way to talk to your database, and it is not always the fastest. These guides help you pick the right tool and get the most out of a lightweight one.
- EF Core vs Dapper: When to Use Each
- Dapper in .NET: A Complete Guide
- EF Core and PostgreSQL: Getting Started Guide
Bulk Operations
When you need to insert or update thousands of rows, the standard SaveChanges() approach won't cut it. These articles show you how to handle bulk data efficiently.
- Fast SQL Bulk Inserts with C# and EF Core
- What You Need to Know About EF Core Bulk Updates
- How to Use the New Bulk Update Feature in EF Core 7
- Optimizing Bulk Database Updates in .NET
Concurrency and Locking
Concurrent access to the same data can cause race conditions and data corruption. EF Core provides built-in mechanisms to handle this safely.
- Solving Race Conditions with EF Core Optimistic Locking
- A Clever Way to Implement Pessimistic Locking in EF Core
- Working with Transactions in EF Core
- Optimistic Concurrency With Postgres xmin in EF Core
- PostgreSQL Locking for .NET Developers
Advanced Features
EF Core has a rich feature set beyond basic CRUD. These articles cover interceptors, raw SQL, soft deletes, multi-tenancy, and more.
- 5 EF Core Features You Need to Know
- How to Use EF Core Interceptors
- EF Core Raw SQL Queries
- Implementing Soft Delete with EF Core
- Multi-Tenant Applications with EF Core
- Using Multiple EF Core DbContext in a Single Application
- Using Stored Procedures and Functions with EF Core and PostgreSQL
- EF Core Compiled Models for Faster Startup
- DbContext Pooling in EF Core
- EF Core Connection Resiliency
- Understanding the EF Core Change Tracker
What's New in EF Core 10
EF Core 10 ships with .NET 10 and adds features that used to require workarounds. These articles cover what changed and how to put it to use.
- Named Query Filters in EF 10: Multiple Query Filters Per Entity
- What's New in EF Core 10: LeftJoin and RightJoin Operators in LINQ
Migrations and Schema Management
Keeping your database schema in sync with your code is a critical part of any EF Core project.
- EF Core Migrations: A Detailed Guide
- EF Core Migrations Best Practices
- Zero-Downtime EF Core Migrations
- How to Roll Back an EF Core Migration
- EF Core Migration Bundles for CI/CD Deployments
- Seeding Data in EF Core: Strategies and Best Practices
Data Modeling and Mapping
How you map your model shapes every query EF Core generates. These guides cover relationships, inheritance, and the mapping features that keep your schema and your domain model in sync.
- Configuring Entity Relationships in EF Core
- Owned Types in EF Core for DDD Value Objects
- Complex Types in EF Core 8: What You Need to Know
- Shadow Properties in EF Core Explained
- Value Conversions in EF Core Explained
- Table Per Hierarchy vs Table Per Type in EF Core
- Composite Primary Keys in EF Core
- Mapping Enums in EF Core
- Mapping JSON Columns in EF Core
- Computed Columns in EF Core
- Modeling Hierarchical Data in EF Core
- Custom Model Conventions in EF Core
- Cascade Delete in EF Core: Behaviors and Pitfalls
Data Access Patterns
Patterns and configuration decisions that shape how the rest of your application talks to EF Core.
- EF Core DbContext: Configuration and Best Practices
- Repository Pattern in C# With Entity Framework Core
- Unit of Work Pattern With EF Core
- Audit Logging With EF Core Interceptors
- Temporal Tables in EF Core for Data Auditing
- How to Use EF Core With Multiple Databases
- Identity vs Sequence vs HiLo Key Generation in EF Core
Troubleshooting Common Errors
Runtime errors with an exact exception message are usually the fastest to fix once you know the cause.
- Fixing "The Instance of Entity Type Cannot Be Tracked" in EF Core
- Fixing PendingModelChangesWarning in EF Core 9
- Fixing "Cannot Write DateTime with Kind=Local" With Npgsql
Summary
Most EF Core slowdowns come from query shape, excess change tracking, or too many database round trips. Log the generated SQL, measure the slow query in the database, and fix the query itself before reaching for compiled queries or other low-level tuning.
The sections above run from quick wins to advanced strategies, and query optimization is where the biggest gains hide. The rest of the library covers bulk operations, concurrency, data modeling, migrations, and the runtime errors that come with an exact exception message.
Frequently Asked Questions
What should I optimize first in an EF Core application?
Start by logging the generated SQL and measuring the slow query in the database. Fix N+1 round trips, project only required columns, add indexes for selective predicates, and remove tracking from read-only entity queries before considering lower-level optimizations.
Should every read query use AsNoTracking?
Use AsNoTracking for entity queries that will not be updated through that DbContext. A DTO projection is often better for API reads because it selects only required columns and does not materialize tracked entities in the first place.
Is AsSplitQuery always faster than one joined query?
No. Split queries avoid cartesian duplication when loading several collections, but they add database round trips and may observe changes between statements. Inspect the generated SQL and measure both shapes for the actual graph.
When do compiled EF Core queries help?
They help on hot paths where repeated LINQ compilation is measurable compared with cheap database work. They rarely matter when network and database execution dominate, so benchmark before adding the extra query definition.



