Eric M Russell - Monday, January 16, 2017 8:34 AM
Eric, you said a mouthful. There are a lot of coders, but not a lot of people who understand how things work. I'm not a consultant, but am asked to resolve performance problems internally. Too many times I hear "you're right that the structure needs work, but we have a lot of things built around it so we can't change it" as the reason for not making real change. The code is most often the source of the problem (the scalar function in the WHERE clause like you said or an implicit cast on a join) but the underlying design is sometimes the limit on making huge improvements.
I also encounter the "hey, it works" syndrome where people get defensive about their code and don't believe it can be made any faster. When it is made 30x faster, they think there's a trick somewhere. Naturally, it couldn't be their cursor. Sadly, I know I'll encounter the same code and the same attitude again soon.