Since my name and my mantra have come up at least once on this thread, I thought I take the time to respond.
Some good folks have stated that they always test things before they use them and I bow deeply to them for that. Some of those same folks have also made statements about getting the job done on time and I, again, bow deeply to them for that.
But that's part of the problem with articles that don't have any or, at best, have only unsupported claims of performance. There are a huge number of people that are under the gun to get the job done right away and may not be equipped to solve a problem like this on their own nor do they have the time (or, possibly, the skills) to test the various solutions published in any given article. Of course, they turn to the internet and find articles like this one and see a solution that works and they blindly go ahead and use it.
You might ask, "If all the solutions work, what does it really matter which one they pick to get their job done"?
I'm a DBA and maybe I take my job a little too seriously. My primary concern is to protect data even if it's not my data and has no effect on me or the company I work for. Since all of the code works, in this case, no problem. The other thing is to protect Developers. I don't know of any group of people who are more under the gun to get things done than Developers whether they're GUI Developers, Database Developers, or people that have to do both. I also try to protect companies from themselves and the mistakes that Developers make.
To wit, slow code can cost a company a serious black eye if even one customer bad mouths another for writing code that bogged down during critical times or as the data scaled up. If enough people believe in that black eye, that company might lose customers. If the company loses customers, it might not be able to support the Developers it has and start laying good people off and could even go out of business. All of that because some manager was pushing Developers to get the job done and they did.
So, personally, I'm really disappointed when I see an article that advertises multiple methods with no performance tests. It doesn't take "reams and reams" of test code (although I'm certainly guilty there) and, as a reader, you can chose to ignore such testing. But for Joe-bag-o-donuts trying to squeak out a living, such performance tests might make the difference between him keeping a job or being laid off.
The early responders to this article have been chastised for being a bit harsh about the whole thing. Perhaps they could have chosen different words or tones but the bottom line, in my humble opinion, is that they were absolutely right in speaking up about the lack of testing in this article. Performance of code should only be second to accuracy and it shouldn't be very far behind in importance.
Remember that there are people out there that "want it real bad". As a community, let's try to not give it to them that way.
--Jeff Moden
Change is inevitable... Change for the better is not.
Bill Talada (2/6/2014)
Thanks to the article author for braving this group. There is a clique in these forums that just can't seem to let it go when talking about string parsing. In my opinion they have ruined a good forum with all their petty griping and claiming there is only one right way to do things. I feel sorry for any new members who get bashed by these guys. Most newbies just want to learn the next step in their path. Teaching calculus to a second grader is absurd.
I've found that the "next step" in the path for a newbie is frequently the wrong step. While I absolutely agree that teaching calculus to a second grader is absurd, not teaching math at all or praising little Johnny for coming up with the wrong answer is even worse. I agree that you don't have to bash Johnny for coming up with the wrong answer but you do have to continue to try to teach him the right way and that also means letting him know that he "didn't do it the right way but let me show you how again". The so called "clique" in these forums has demonstrated a high level of concern in the area of teaching newbies and others how to write good SQL and why. In my opinion, they are absolutely necessary to keep nay sayers from ruining a good forum with all their petty griping about good-enough methods that actually aren't.
--Jeff Moden
Change is inevitable... Change for the better is not.
Thanks @Phil for posting that link to the XML splitter.
That was some good information and cool to learn.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Qualitas Software (2/6/2014)
Another option or variation on the solutions offered would be to parse the string using CLR ?We have gone down this route before and, without digging up the benchmarking(sorry), we found it quicker on CPU.
Further if the list of variables were fixed, such as int (ie- 4byte), our data can be sent using the varbinary(max) datatype and split (again using CLR).
Just some ideas...
That's absolutely true. The CLR will smoke everything including even the latest version of DelimitedSplit8K or any other T-SQL only method, for that matter. If you can use SQLCLR in your environment, I'd recommend it because it also has no performance penalty for going over 8K.
Proof of that can be found in the following article and the article also contains an SQLCLR that Paul White wrote for me that anyone can use. You don't need to know a thing about C# nor even have it installed if you'd like to use such a splitter. (The code is contained in the files in the "Resources" section near the bottom of the article.
http://www.sqlservercentral.com/articles/Tally+Table/72993/
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 15 posts - 16 through 30 (of 54 total)
You must be logged in to reply to this topic. Login to reply