Tutorials ADO.NET Core Tutorial
SQL Profiling — Complete Guide
SQL Profiling — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of ADO.NET Core Tutorial on Toolliyo Academy.
On this page
ADO.NET Core Tutorial · Lesson 74 of 100
SQL Profiling
Foundations ✓ → SQL & safety ✓ → Production → Projects
Production · 3 — ASP.NET & enterprise · ~10 min · Module 8: Testing and Debugging
What is this?
Profile SQL with SSMS Profiler/XEvents/Query Store to see what ADO.NET actually sends.
Why should you care?
ShopNest “slow API” is often one bad query shape.
See it live — copy this example
Use a .NET console or API project with SQL Server LocalDB. Run dotnet run after pasting.
// enable Query Store / XEvents
// run API call
// find query text duration
Console.WriteLine("capture ADO.NET SQL text + duration");
What happened?
- Capture duration and text.
- Correlate with request id if instrumented.
- Fix plans/indexes.
Practice next
- Start XEvents session in lab.
- Hit API.
- Find top duration.
- Filter by application_name.
- Set Application Name=ShopNestApi in CS.
Remember
Capture real SQL. Sort by duration. Fix and verify.
ShopNest Application Name
CS sets Application Name for Profiler.
Outcome: Easy filter of API traffic.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!