Entity Framework Core DB Performance Tuning (for SQL Server)
When implementing database programming with .NET Entity Framework Core, you can learn how to understand DB and query performance issues and improve them to achieve better performance and more stable EF Core programming.
Learn about performance issues and solutions for EF Core auto-generated queries
Learn EF Core and SQL Server features needed to improve DB performance
Performance tuning based on .NET EF/EF Core, More stable & more powerful!
More powerful .NET development, The key is in the query!
“Not all queries generated by EF Core are well-formed.”
In many cases, queries automatically generated or processed by applications using .NET EF or EF Core (or similar ORM environments) are not appropriate for SQL Server, impacting database or query performance . This is especially true for data changes and transaction processing. Furthermore, database administrators often complain about the difficulty of managing queries, such as query tracking and modification.
How to tune DB programming performance based on .NET Entity Framework Core
In this lecture, we will understand the current performance issues and share solutions to implement EF Core, a great programming tool for .NET developers, with better query performance and more stable processing methods. We will also introduce the improved features of the latest version (V7).
To these people I recommend it.
.NET developer
EF Core Developer or user
EF or EF Core Operating in an environment system administrator
DB performance of EF Core Interested Users
💬 “I’m new to .NET development and this is my first time with EF Core. Can I still take this course?”
If you have experience with .NET and EF Core, you'll find the content easier to understand. However, for those new to EF Core, we've also included some helpful learning materials . It's recommended that you review these pre-learning materials beforehand to gain a deeper understanding. Furthermore, the example project is a console application, making it relatively easy to access.
💬 “Will there be differences depending on the EF Core version?”
The materials and demos cover EF5 through the recent EF7 , showcasing the improvements and differences between the new versions, so you can easily navigate them. For key features, we've included introductory versions to help you make informed decisions.
A self that has grown one step further You can meet.
You can program EF Core to generate more performant, appropriate queries .
EF Core can implement Insert/Update/Delete, transactions , and locking more reliably .
You can discuss queries that are expected to have performance issues with DB managers, related departments, and practitioners to prevent problems .
SQL Server query tracing
Set operations and distinct handling
💡 Know-how to resolve query performance issues essential for practical development
Depending on how .NET EF Core is implemented or the form of Lambda/LINQ expressions , the type of automatically generated query varies, which affects query performance and database performance . In this training, you can examine the contents of automatically generated queries according to the EF Core implementation, performance issues, and learn methods to resolve them. You will also understand important problems that arise in practice due to data modification (DML) operations or transaction processing issues.
In particular, the knowledge sharer, who has been consulting and teaching SQL Server for a long time, uses common situations that appear in practice as examples for each topic, so it is organized to be directly helpful for practical application.
Detailed Curriculum ✅
1) Course Introduction
Intro
Pre-learning materials for beginners
Course Introduction
Introducing SalesSimple DB for Demo
Introducing the Visual Studio Demo Project
Visual Studio Configuration Demo and LINQ Expressions (Beginner)
Key Elements of DB Performance Tuning
2) Code-First Performance Considerations
Database property tuning
Data format and length
Specify a composite key or index
Create an index when specifying a foreign (reference) key
3) Query logging and performance monitoring
Tools for query performance monitoring and analysis
Simple Logging
SQL Server query tracing
Dotnet-counters
BenchmarkDotNet
Overview of Data Access Procedures - Query Response Time (T) Consumption Items
4) DB Connection
Connection String Important Items
DbContextOptionsBuilder
DbContextPool
Understanding DB Connection Open and Close Points
Multiple Active ResultSets (MARS) connections
5) Data Retrieval - Part 1
introduction
Synchronous vs. Asynchronous Processing
Ad hoc vs. parameter queries
ToQueryString()
Non-tracking queries
SELECT only the necessary columns (Projection)
Benchmark - Performance by Data Retrieval Method
IQueryable vs. IEnumerable
Where(), Find(), First() vs. FirstOrDefault(), SingleOrDefault()
FirstOrDefault()/SingleOrDefault() and Subquery Issues
SingleOrDefault() and SQL LIKE implementation examples
Using EF.Functions, SQL IN Conditions, and the STRING_AGG() Function
6) Data Retrieval - Part 2
CROSS/INNER/OUTER JOIN
APPLY implementation
.Include(), .ThenInclude(), Split Queries, and EF Internal Buffering
Lazy Loading vs. Eager Loading and Avoiding Unnecessary Duplicate Queries
Set operations (intersection/union/difference) and distinct handling
Inheriting DbCommandInterceptor – Adding Hints to Queries
Setting query hints without modifying application code
Q&A 💬
Q. Is this a course that non-majors can also take?
If you have a basic understanding of .NET and SQL, you can take this course. Even if you lack a little bit, you can study the necessary basics while taking the course.
Q. Is there anything I need to prepare before attending the lecture?
If you're new to .NET EF Core, review and follow the pre-study materials introduced at the beginning of the course. You can also download other materials, including a demo database and an EF Core sample project, in advance. The demo database configuration and content will be explained during the training. You'll also need SQL Server for use as a database, as well as management tools like SSMS, so please install them in advance.
Q. Are there any requirements I need to meet before taking the course?
You'll need Visual Studio (Community Edition or higher) and SQL Server. The latest version is recommended. For .NET beginners, we'll also provide a brief introduction and demonstration of downloading and configuring Visual Studio earlier in the course.
The knowledge sharer of this lecture Introducing.
Kim Jeong-seon SQL
History
CEO/Director of Sequlo Co., Ltd. (www.sqlroad.com) (since 2005)
SQL Server consulting, technical support, lectures, and solution development
Development of SQLBigEyes (SQL Server performance monitoring solution, www.sqlbigeyes.com)
Development of SQLBigEyes (SQL Server performance monitoring solution, www.sqlbigeyes.com)
Microsoft Data Platform MVP
Awarded for 21 years since 2002 (as of 2022), MVP Achievement Award in 2008