April 27, 2012 at 2:24 pm
Sean Lange (4/27/2012)
I particularly liked his last comment.i am putting it in if condition,does that is the problem?
I know exactly where the problem is...that big blob right between the keyboard and the chair.
Sorry - I will try and work on my figure...:crying:
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
April 27, 2012 at 2:28 pm
SQLRNNR (4/27/2012)
Lynn Pettis (4/27/2012)
L' Eomot Inversé (4/27/2012)
GilaMonster (4/27/2012)
Lynn Pettis (4/27/2012)
Gail, without really digging into this, isn't this just an expensive NOP?Yup.
On the plus side, SQL's smart enough not to log the update.
Or maybe that's part of the minus side - if it wasted disc IO logging the non-update maybe people would notice something was wrong.
Although if they have things like that in their system, and haven't noticed any effect, maybe not.
I think he-who-is-without-clues has relatives all around the world working in various IT shops. 😛
Why is everybody so afraid to say his name?
Just say it already: VOLDEMORT
No, VOLDEMORT was only missing one clue. He didn't realize what Harry really was. As long as Harry lived, he could not die.
He-who-is-without-clues doesn't even realize he is his biggest problem.
April 27, 2012 at 2:33 pm
SQLRNNR (4/27/2012)
Sean Lange (4/27/2012)
I particularly liked his last comment.i am putting it in if condition,does that is the problem?
I know exactly where the problem is...that big blob right between the keyboard and the chair.
Sorry - I will try and work on my figure...:crying:
Whatcha mean? You are in shape...round is a shape right??
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 27, 2012 at 2:36 pm
Sean Lange (4/27/2012)
SQLRNNR (4/27/2012)
Sean Lange (4/27/2012)
I particularly liked his last comment.i am putting it in if condition,does that is the problem?
I know exactly where the problem is...that big blob right between the keyboard and the chair.
Sorry - I will try and work on my figure...:crying:
Whatcha mean? You are in shape...round is a shape right??
:hehe:
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
April 27, 2012 at 2:44 pm
Lynn Pettis (4/27/2012)
L' Eomot Inversé (4/27/2012)
GilaMonster (4/27/2012)
Lynn Pettis (4/27/2012)
Gail, without really digging into this, isn't this just an expensive NOP?Yup.
On the plus side, SQL's smart enough not to log the update.
Or maybe that's part of the minus side - if it wasted disc IO logging the non-update maybe people would notice something was wrong.
Although if they have things like that in their system, and haven't noticed any effect, maybe not.
I think he-who-is-without-clues has relatives all around the world working in various IT shops. 😛
I was sorely tempted to leap in on some of he-who-is-without-clues' threads, but managed to resist. Having seen some more of his posts, I'm glad I did!
Tom
April 27, 2012 at 3:04 pm
L' Eomot Inversé (4/27/2012)
Lynn Pettis (4/27/2012)
L' Eomot Inversé (4/27/2012)
GilaMonster (4/27/2012)
Lynn Pettis (4/27/2012)
Gail, without really digging into this, isn't this just an expensive NOP?Yup.
On the plus side, SQL's smart enough not to log the update.
Or maybe that's part of the minus side - if it wasted disc IO logging the non-update maybe people would notice something was wrong.
Although if they have things like that in their system, and haven't noticed any effect, maybe not.
I think he-who-is-without-clues has relatives all around the world working in various IT shops. 😛
I was sorely tempted to leap in on some of he-who-is-without-clues' threads, but managed to resist. Having seen some more of his posts, I'm glad I did!
you did not miss any thing. just typing in bytes of information that are being viewed by blind eyes. (would go with words falling on deaf ears but can you really hear text??)
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
April 27, 2012 at 3:08 pm
capn.hector (4/27/2012)
L' Eomot Inversé (4/27/2012)
Lynn Pettis (4/27/2012)
L' Eomot Inversé (4/27/2012)
GilaMonster (4/27/2012)
Lynn Pettis (4/27/2012)
Gail, without really digging into this, isn't this just an expensive NOP?Yup.
On the plus side, SQL's smart enough not to log the update.
Or maybe that's part of the minus side - if it wasted disc IO logging the non-update maybe people would notice something was wrong.
Although if they have things like that in their system, and haven't noticed any effect, maybe not.
I think he-who-is-without-clues has relatives all around the world working in various IT shops. 😛
I was sorely tempted to leap in on some of he-who-is-without-clues' threads, but managed to resist. Having seen some more of his posts, I'm glad I did!
you did not miss any thing. just typing in bytes of information that are being viewed by blind eyes. (would go with words falling on deaf ears but can you really hear text??)
The really sad part of all of this, is when he finally finishes writing this code and it goes into production, the next post we'll see is that it takes too long to run, what can I do to improve its performance?
April 27, 2012 at 9:34 pm
Lynn Pettis (4/27/2012)
capn.hector (4/27/2012)
L' Eomot Inversé (4/27/2012)
Lynn Pettis (4/27/2012)
L' Eomot Inversé (4/27/2012)
GilaMonster (4/27/2012)
Lynn Pettis (4/27/2012)
Gail, without really digging into this, isn't this just an expensive NOP?Yup.
On the plus side, SQL's smart enough not to log the update.
Or maybe that's part of the minus side - if it wasted disc IO logging the non-update maybe people would notice something was wrong.
Although if they have things like that in their system, and haven't noticed any effect, maybe not.
I think he-who-is-without-clues has relatives all around the world working in various IT shops. 😛
I was sorely tempted to leap in on some of he-who-is-without-clues' threads, but managed to resist. Having seen some more of his posts, I'm glad I did!
you did not miss any thing. just typing in bytes of information that are being viewed by blind eyes. (would go with words falling on deaf ears but can you really hear text??)
The really sad part of all of this, is when he finally finishes writing this code and it goes into production, the next post we'll see is that it takes too long to run, what can I do to improve its performance?
There is ALWAYS something to do to improve performance.
The only questions, IMO, are, how much, and is it worth it.
April 28, 2012 at 8:42 pm
Lynn, have you ever considered asking an OP to include himself in an execution plan?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 29, 2012 at 11:19 am
SQL Saturday out here in Phoenix was a lot of fun, and of particular interest I met a LOT of good people, including finally getting a chance to meet our illustrious Steve Jones.
Oh, Jeff? If you get a random thump up the back of the head (for no particular reason, I thought it was a funny idea at the time) from someone in your usergroup, that's my doing. 😉 You can pay me back sometime. 🙂
Woot woot!
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
April 29, 2012 at 1:53 pm
Evil Kraig F (4/29/2012)
SQL Saturday out here in Phoenix was a lot of fun, and of particular interest I met a LOT of good people, including finally getting a chance to meet our illustrious Steve Jones.Oh, Jeff? If you get a random thump up the back of the head (for no particular reason, I thought it was a funny idea at the time) from someone in your usergroup, that's my doing. 😉 You can pay me back sometime. 🙂
Woot woot!
+1
Very nice event, and great to meet Craig in person. He has a hat, too :w00t:
April 29, 2012 at 8:39 pm
WayneS (4/27/2012)
dwain.c (4/27/2012)
Alert! To any of you really serious T-SQL folk out there, drinking at this water cooler, that want a real challenge.Check out this thread: http://www.sqlservercentral.com/Forums/Topic1290424-392-1.aspx
Maybe I've overcomplicated it or was thinking too much, but I finally came up with a solution that may work or possibly not. I simply don't know.
I'm guessing no optimal solution can be done without a CURSOR loop, and then the solution you get depends on how you write the loop!
I'm pretty darn sure that no one can do it with a single SQL INSERT (although I'd be tickled to be wrong).
Hi Dwain,
First... welcome to The Thread!
I posted something over there... I think a sliding window, possibly with some of the new analytic functions could solve this issue (requires SQL 2012 for both). Don't want to pursue this further unless that is an option... but I just might do it anyway as a proof-of-concept for it.
I for one would be interested to see how you'd solve this in SQL 2012.
While I posted a solution (followed by what I think is a better one), I'm not 100% satisfied that either of my solutions actually fits the problem.
Interesting that no one else gave this poor lady any actionable suggestions. I'm guessing because it is certainly not a low hanging fruit. The problem is complex (at least to my simple thinking).
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?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
April 30, 2012 at 5:56 am
dwain.c (4/29/2012)
WayneS (4/27/2012)
dwain.c (4/27/2012)
Alert! To any of you really serious T-SQL folk out there, drinking at this water cooler, that want a real challenge.Check out this thread: http://www.sqlservercentral.com/Forums/Topic1290424-392-1.aspx
Maybe I've overcomplicated it or was thinking too much, but I finally came up with a solution that may work or possibly not. I simply don't know.
I'm guessing no optimal solution can be done without a CURSOR loop, and then the solution you get depends on how you write the loop!
I'm pretty darn sure that no one can do it with a single SQL INSERT (although I'd be tickled to be wrong).
Hi Dwain,
First... welcome to The Thread!
I posted something over there... I think a sliding window, possibly with some of the new analytic functions could solve this issue (requires SQL 2012 for both). Don't want to pursue this further unless that is an option... but I just might do it anyway as a proof-of-concept for it.
I for one would be interested to see how you'd solve this in SQL 2012.
While I posted a solution (followed by what I think is a better one), I'm not 100% satisfied that either of my solutions actually fits the problem.
Interesting that no one else gave this poor lady any actionable suggestions. I'm guessing because it is certainly not a low hanging fruit. The problem is complex (at least to my simple thinking).
First I'll agree that there certainly isn't any SQL 2008 R2 solution that doesn't use a loop (this is only true because the recursive subqueries feature is broken in a couple of ways at a very fundamental level, with an unbroken version it would be reasonably straightforward).
Second, your last solution looks roughly right - can only say roughly as I haven't had time to check in detail because I'm flying back to the UK today, so have only a very short time to indulge in SQL instead of packing and closing up house and so on.
Third, sliding windows might simplify the code, might even make it possible to write a recursive CTE that would do the job; but I'm pretty sure thay wouldn't! So I suspect that even with SQL 2012 it would still need a loop.
Tom
April 30, 2012 at 7:25 am
Okay Steve, I submitted my QotD this morning. You may need to do some fiddling with the image. If you have any questions, drop me an email.
April 30, 2012 at 7:33 am
Lynn Pettis (4/30/2012)
Okay Steve, I submitted my QotD this morning. You may need to do some fiddling with the image. If you have any questions, drop me an email.
Will do
Viewing 15 posts - 35,881 through 35,895 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply