EF Core Query Performance Tips for Everyone
EF Core does not make queries fast by default. You do. This guide shows how to cut query time by fetching less with projection, turning on AsNoTracking for reads, avoiding N+1, choosing AsSplitQuery for big includes, paginating, indexing and compiling hot queries. Each concept comes with small runnable C# snippets and clear explanations so you can apply them today without rewriting your app.
EF Core query performance that actually feels fast
You know that feeling when an API that was snappy yesterday suddenly needs a coffee break today? I once watched a dashboard endpoint turn a sub 200 ms request into a 6 second slog. The database server sounded like a TIE fighter and my CPU fan tried to take flight. The fix did not require dark magic. It required fetching less.
In this post we will walk through practical EF Core habits that make queries fast. We will project only what we need, avoid accidental N+1s, stop calling ToList too early, opt into AsNoTracking for reads, choose AsSplitQuery when includes explode, paginate, use indexes, and even compile hot queries. All with small, runnable C# snippets.