T-SQL User-defined functions, or: How to kill performance in one easy step — Hugo Kornelis

Опубликовано: 03 Ноябрь 2024
на канале: GroupBy
217
1

Want to learn more about GroupBy’s Sponsors? Check them out below!

SolarWinds: https://loom.ly/WBIxdm0
Redgate: https://loom.ly/mWU0yLs

User-defined functions in SQL Server are very much like custom methods and properties in .Net languages. At first sight, they seem to be the perfect tool to introduce code encapsulation and reuse in T-SQL. So why is this feature mostly avoided by all T-SQL gurus?
The reason is performance. In this session, you will learn how user-defined functions feed the optimizer with misleading and insufficient information, how the optimizer fails to use even what little information it has, and how this can lead to shocking query performance.
However, you will also see that there is a way to avoid the problems. With just a little extra effort, you can reap the benefits of code encapsulation and reuse, and still get good performance.


Download Speaker Slides: https://sqlserverfast.com/presentatio...