What Happens If I Write This?
Proposed session for SQLBits 2026TL; DR
A Live T-SQL Experiment Session where we look at patterns and test them live. The good, the bad and the ugly.
Session Details
We all write T-SQL that seems reasonable, but do we really know how SQL Server will execute it?
In this live, experiment-driven session, we’ll take common (and not-so-common) T-SQL patterns and put them to the test in SQL Server. Using real queries, real data, and real execution plans, we’ll explore what actually happens when you write different joins, predicates, window functions, and subqueries. Along the way, we’ll intentionally break best practices, challenge assumptions, and uncover surprising optimizer behavior.
Attendees will be encouraged to predict outcomes before we run each query, turning the session into an interactive learning experience. You’ll leave with a stronger intuition for how SQL Server processes T-SQL, why some “obvious” choices perform poorly, and how small changes in query structure can lead to dramatically different execution plans.
This session is less about rules and more about understanding, so the next time you write T-SQL, you’ll know what happens before you hit execute.
In this live, experiment-driven session, we’ll take common (and not-so-common) T-SQL patterns and put them to the test in SQL Server. Using real queries, real data, and real execution plans, we’ll explore what actually happens when you write different joins, predicates, window functions, and subqueries. Along the way, we’ll intentionally break best practices, challenge assumptions, and uncover surprising optimizer behavior.
Attendees will be encouraged to predict outcomes before we run each query, turning the session into an interactive learning experience. You’ll leave with a stronger intuition for how SQL Server processes T-SQL, why some “obvious” choices perform poorly, and how small changes in query structure can lead to dramatically different execution plans.
This session is less about rules and more about understanding, so the next time you write T-SQL, you’ll know what happens before you hit execute.
3 things you'll get out of this session
Predict how SQL Server will execute common T-SQL patterns by recognizing how small changes in query structure affect execution plans and performance.
Identify risky or misleading T-SQL constructs that appear correct but often lead to inefficient plans, excessive resource usage, or unexpected results.
Apply practical query rewrites with confidence to influence the optimizer toward more efficient execution without relying on guesswork or folklore.
Speakers
Rich Benner's other proposed sessions for 2026
Hidden Power in SQL Server 2025: Off by Default, On by Choice - 2026
Level Up Your Stack with SQL Server 2025’s New Dev Features - 2026
Performance that Just Works: SQL Server 2025 Engine Enhancements - 2026
Death by a Thousand Cuts: Small T-SQL Mistakes That Destroy Performance - 2026
Using AI for Performance Tuning in SQL 2025 - 2026