Description:
In this video, I delve into the world of query tuning for Rogals, discussing how to optimize queries that return a single row but take an unexpectedly long time to run. By leveraging techniques such as using TOP hints and row goals, we explore ways to guide SQL Server towards more efficient execution plans without resorting to potentially problematic hints like RECOMPILE or OPTIMIZE FOR UNKNOWN. I also highlight the importance of understanding how these techniques interact with index usage and optimizer behavior, providing practical examples that can help you achieve better query performance in your own databases.
CHAPTERS
00:00:00 - Introduction
00:01:34 - Top Operator and Row Goals Overview
00:03:19 - Using Top with Exists
00:06:25 - Cross Apply and Top for Nested Loops Joins
00:08:38 - Optimizing for Small Numbers with Parameterized Top
00:10:40 - Row Goals and Query Plan Optimization
00:12:39 - Conclusion
━━━━━━━━━━━━━━━━━━━━━━━━━━
???? 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















































