In this video, I delve into the concept of sargability in SQL Server queries, using a more relaxed approach than some might be comfortable with. Sargability typically refers to writing expressions that allow SQL Server to effectively use indexes for searches, but I extend this idea to include how wrapping columns or functions can disrupt index order and affect query performance, even outside the context of joins and where clauses. By demonstrating practical examples, such as sorting and grouping operations, I illustrate how seemingly minor changes in code can lead to significant differences in execution plans and performance. Throughout the video, I emphasize that while these issues might not be immediately catastrophic, they can accumulate over time, especially with larger datasets or more complex queries, leading to noticeable performance degradation. I also take this opportunity to beg for your support by asking you to like, subscribe, comment, and consider purchasing training from me if you find the content valuable. After all, helping me grow my channel means a bigger audience when I eventually do need to run ads-someday, hopefully not too soon!
CHAPTERS
00:00:00 - Introduction
00:02:19 - Sargability in Context
00:04:33 - Query Example Setup
00:05:05 - Query Execution Results
00:07:06 - Index Utilization Issues
00:08:45 - Performance Comparison
━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 TRAINING & COURSES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Get AI-Ready With Erik
https://training.erikdarling.com/get-...
SQL Server Performance Engineering Course
https://training.erikdarling.com/sql-...
Learn T-SQL with Erik
https://training.erikdarling.com/lear...
Everything Bundle:
https://training.erikdarling.com/?cou...
━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ CONSULTING & SERVICES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Need SQL Server performance help?
https://training.erikdarling.com/sqlc...
━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 CONNECT
━━━━━━━━━━━━━━━━━━━━━━━━━━
Ask questions at Office Hours
https://erikdarling.com/officehours/
Become a channel member
/ @erikdarlingdata
━━━━━━━━━━━━━━━━━━━━━━━━━━