Description:
In this video, I delve into the nuances of query plans and execution costs, addressing common misconceptions about how SQL Server calculates and displays these metrics. I share practical examples that demonstrate why focusing solely on cost percentages can be misleading, emphasizing the importance of understanding operator times instead. By walking through a series of queries, I illustrate how costs shift based on context, highlighting the differences between row mode and batch mode plans. Additionally, I explore the concept of trivial plans and simple parameterization, explaining how SQL Server's decisions in these scenarios impact query optimization and plan caching. The video also covers various costing factors, such as aggregate type selection and the three search phases that influence query execution planning, providing valuable insights into the inner workings of SQL Server's optimizer.
CHAPTERS
00:00:00 - Introduction
00:01:58 - Cost Differences Analysis
00:03:50 - Operator Times and Query Plan Examination
00:04:22 - Caboose Operator Explanation
00:05:08 - Parallel Exchange Operators
00:06:09 - Gather Streams Operator Time
00:07:01 - Batch Mode vs Row Mode Operators
00:07:41 - Constraint Creation and Plan Caching
00:08:32 - Zero Row Query Analysis
00:09:21 - Non-Cachable Plans
00:10:55 - Hash Match Aggregate Choice
00:12:15 - Search Phases Overview
00:14:03 - Optimizer Simplification
━━━━━━━━━━━━━━━━━━━━━━━━━━
???? TRAINING & COURSES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Get AI-Ready With Erik
https://training.erikdarling.com/get-ai-ready-with-erik?coupon=AIREADY
SQL Server Performance Engineering Course
https://training.erikdarling.com/sql-server-performance-engineering?coupon=ENGINEERING
Learn T-SQL with Erik
https://training.erikdarling.com/learn-t-sql-with-erik?coupon=ADVANCEDTSQL
Everything Bundle:
https://training.erikdarling.com/?coupon=SPRINGCLEANING
━━━━━━━━━━━━━━━━━━━━━━━━━━
????️ CONSULTING & SERVICES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Need SQL Server performance help?
https://training.erikdarling.com/sqlconsulting
━━━━━━━━━━━━━━━━━━━━━━━━━━
???? CONNECT
━━━━━━━━━━━━━━━━━━━━━━━━━━
Ask questions at Office Hours
https://erikdarling.com/officehours/
Become a channel member
https://www.youtube.com/@ErikDarlingData/join
━━━━━━━━━━━━━━━━━━━━━━━━━━
Share this link via
Or copy link















































