Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Set based super challenge Rate Topic Display Mode Topic Options
Author
 Message
 Posted Thursday, December 12, 2013 3:30 AM
 Hall of Fame Group: General Forum Members Last Login: Today @ 4:39 AM Points: 3,594, Visits: 5,105
 ChrisM@Work (12/12/2013)`-- I might give it a go over lunch.----------------------------------------------------------------------------------------`I can see it now. Cornish pasty in one hand while the other furiously types in the 1M row test harness.Mmmm, mmmm! My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!My thought question: Have you ever been told that your query runs too fast?My advice:INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.Need to UNPIVOT? Why not CROSS APPLY VALUES instead?Since random numbers are too important to be left to chance, let's generate some!Learn to understand recursive CTEs by example.Splitting strings based on patterns can be fast!
Post #1522217
 Posted Thursday, December 12, 2013 4:14 AM
 SSC Rookie Group: General Forum Members Last Login: Monday, March 10, 2014 9:36 AM Points: 38, Visits: 139
 Thanks Chris. I think you have done enough already
Post #1522225
 Posted Thursday, December 12, 2013 4:38 AM
 SSCertifiable Group: General Forum Members Last Login: Thursday, April 17, 2014 9:33 AM Points: 6,754, Visits: 12,854
 dwain.c (12/12/2013)ChrisM@Work (12/12/2013)`-- I might give it a go over lunch.----------------------------------------------------------------------------------------`I can see it now. Cornish pasty in one hand while the other furiously types in the 1M row test harness.Mmmm, mmmm! Good Lord no Dwain, I'd use one of Jeff's fancy shmancy tally tables!! “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #1522234
 Posted Thursday, December 12, 2013 6:45 AM
 SSCertifiable Group: General Forum Members Last Login: Thursday, April 17, 2014 9:33 AM Points: 6,754, Visits: 12,854
 dwain.c (12/11/2013)Jeff Moden (12/11/2013)ChrisM@Work (12/11/2013)Gosh, I'm surprised that with a title like this, there have been so few takers - and so little feedback from the OP. Maybe those sleepless nights have caught up. Here's a simple solution for starters.I don't know what's going on with the OP but when I see that ChrisM has worked a problem, I figure there's little left for me to do and move on. I feel the same way! I did look at this thread yesterday and saw that Chris suggested there was something wrong with the sample data/results so I passed on it at the time.That's 'cos I always pick the easy ones “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #1522285

 Permissions