🚀 EntityFramework Core (EF Core): How to optimize a query?

Опубликовано: 18 Май 2026
на канале: Saeed Esmaeelinejad
4,894
174

Do you want to make your queries more performant and efficient?

Then this is the way you go!

I've tried to address most cases in a Real-world query that you may face in your projects and fix them.

If you saw my previous videos, I always like to explain the current situation and how to make it better, and finally code, I believe you grasp the concept better.

Hope you enjoy it!

Repo[EFQueryOptimization]: https://github.com/sa-es-ir/youtube-s...

Moments

00:00 - Intro
00:26 - Showing the Slow query
02:45 - Check what query exactly is needed?
03:46 - Enabling EF core logs for queries
04:45 - Select only the required columns
09:21 - Decrease database roundtrips
10:49 - Remove extra Includes
11:32 - The worst thing a developer can do!
13:08 - Prefer checking numbers over strings
14:05 - Put conditions on the database side
15:33 - Use Pagination
16:10 - Run optimized query
17:30 - Optimize Contains method
21:25 - Optimize Database side
24:18 - Run the Benchmark!

#dotnet #csharp #querytuning #database #performance #queryoptimization #efcore #entityframework #optimization

---------------------------------------------------------------
Follow me on LinkedIn:
  / sa-es-ir