SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Bad Scalar Functions (or other UDF)


Bad Scalar Functions (or other UDF)

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)

Group: Administrators
Points: 594546 Visits: 21007
If you can share a story of a real scalar or multi-statement table UDF and how you fixed it, I'd like articles here. Even if the fix is changing application code.

The idea is to help people understand the issues with functions and performance by providing concrete examples.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
pietlinden
pietlinden
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52022 Visits: 16664
Steve,

See if Kevin Boles has any horror stories that aren't confidential. =)
Steve Jones
Steve Jones
SSC Guru
SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)

Group: Administrators
Points: 594546 Visits: 21007
Kevin doesn't like writing. I need someone that wants to document and describe an issue.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)

Group: General Forum Members
Points: 859505 Visits: 47085
Steve Jones - SSC Editor (5/19/2016)
I need someone that wants to document and describe an issue.


I've recently fixed a monster that was necessarily (used in a Persisted Computed Column) a Scalar Function and I started to write about it.

Don't let this hold anyone else up, though. This sounds like a very wide open topic that a whole lot of people could have fun with.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Steve Jones
Steve Jones
SSC Guru
SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)

Group: Administrators
Points: 594546 Visits: 21007
Thanks, Jeff. Hoping for a few pieces. We have the one you wrote on moving a scalar UDF to a CROSS APPLY, but I'd like to get more references for specific functions that might do strange things.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
sqltung
sqltung
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3302 Visits: 585
I recently found one or two issues at work with scalar functions. I would be happy to contribute an article with examples.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)SSC Guru (594K reputation)

Group: Administrators
Points: 594546 Visits: 21007
sqltung (7/22/2016)
I recently found one or two issues at work with scalar functions. I would be happy to contribute an article with examples.


That would be great. IF you can do the setup, the bad performance, and how you fixed things, showing better performance, excellent. If this is 3 pages for each, then make it two articles.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)SSC Guru (859K reputation)

Group: General Forum Members
Points: 859505 Visits: 47085
Steve Jones - SSC Editor - Friday, May 20, 2016 10:18 AM
Thanks, Jeff. Hoping for a few pieces. We have the one you wrote on moving a scalar UDF to a CROSS APPLY, but I'd like to get more references for specific functions that might do strange things.


My sincere apologies. I'm way overdue on this and other articles (it's been several years since I put one out there). Hopefully, things will lighten up on my end and I'll be able to crank the one I was thinking of for this out soon.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search