Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Set based super challenge Expand / Collapse
Author
Message
Posted Thursday, December 12, 2013 3:30 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 4:14 AM
Points: 3,618, Visits: 5,254
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

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 5:11 AM
Points: 40, Visits: 146
Thanks Chris. I think you have done enough already


Post #1522225
Posted Thursday, December 12, 2013 4:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:50 AM
Points: 7,191, Visits: 13,645
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 Shaw

For 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 Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1522234
Posted Thursday, December 12, 2013 6:45 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:50 AM
Points: 7,191, Visits: 13,645
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 Shaw

For 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 Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1522285
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse