Info

GroupBy – Free SQL Server Training

GroupBy.org is free technical training by the community, for the community. Volunteer speakers submit abstracts at GroupBy.org and you – the attendee – vote to pick the sessions. Want to present your own session or just vote on others? Join us at GroupBy.org.
RSS Feed
GroupBy – Free SQL Server Training
2017
June
May
April
March
February
January


All Episodes
Archives
Now displaying: Page 1
Feb 28, 2017

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. One type of user-defined function, the inline table-valued type, may not be the easiest to use, but it is the only type of user-defined function that doesn’t impact performance. I will show how, with just a little extra effort, you can reap the benefits of code encapsulation and reuse without sacrificing performance.

0 Comments