A Foreign Key Join Elimination Limitation In SQL Server

Опубликовано: 22 Март 2026
на канале: Erik Darling (Erik Darling Data)
548
48

In this video, I dive into a peculiar and somewhat annoying limitation involving foreign keys and join elimination in SQL Server. I explore how, under certain circumstances, SQL Server's confidence in the presence of data through foreign keys can waver when checking for missing or non-existent records, leading to unnecessary full table scans. This behavior is particularly frustrating given its inconsistent nature and the rare utility it provides. If you're interested in supporting this channel, consider becoming a member sponsor with low-cost options available. Your likes, comments, and subscriptions also make my day, so don't hesitate to engage! Additionally, if you need SQL Server consulting or performance tuning training, I offer affordable packages that can help optimize your database operations.

CHAPTERS

00:00:00 - Introduction
00:00:59 - Foreign Key Meme White Knighting
00:03:07 - Data Warehouse Considerations
00:04:12 - Sponsorship Options
00:07:41 - Query Plan Analysis
00:09:21 - SQL Server's Dumbness
00:11:16 - Conclusion

━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 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  
━━━━━━━━━━━━━━━━━━━━━━━━━━