January 15, 2014 at 7:48 am
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.
Steve, did I miss something here?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 15, 2014 at 8:18 am
Grant Fritchey (1/14/2014)
Sean Lange (1/14/2014)
Here is a true story from the field that a buddy of mine shared with me yesterday.Yesterday my supervisor sent me an email regarding a view that wasn't returning accurate info to the users and he wanted me to look at it. Unfortunately I was unable to last night as I was busy with another priority that took all night.
The view uses a lot of subqueries in the select list, many of them from the same tables, and used group by with select top 1. Needless to say these subqueries could (and was) pulling data from different records with the same parent key. I wonder why the information was inconsistent.
Well, my supervisor decided to try and tackle the problem and rewrite the view. He moved the subqueries to left outer joins in the FROM clause but was not working very well. He didn't have time to use the DTA to help tune the indexes to help improve his query, so when I got in he turned it back over to me.
After about an hour, I had consolidated the multiple individual subqueries into three subqueries using outer apply in the FROM clause. The original view with inaccurate data ran in about 33 seconds. My rewrite runs in 6 seconds, and I am sure I could come up with a few covering indexes on the subtables that would increase the performance more. Both versions return about 56,000 rows of data. My boss’s, well I stopped it after 2 hours and 16 minutes and it had only returned a little over 20,000 rows.
Goes to show that you should leave rewriting SQL to the professionals.
DTA!!!!!!
Burn it with fire!!!
I agree. My post was a direct copy and paste, not my interpretation. 🙂
_______________________________________________________________
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/
January 15, 2014 at 9:24 am
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
January 15, 2014 at 12:36 pm
Steve Jones - SSC Editor (1/15/2014)
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
WOW! You've done quite a bit; no wonder you have a knee injury. Whatever you do, take the time to let it heal when your surgery is done. I'm curious...what style of karate did you study?
January 15, 2014 at 1:06 pm
Steve Jones - SSC Editor (1/15/2014)
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
Wow... I really sorry to hear about this. Sure hoping it heals fine, without issues, fast.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
January 15, 2014 at 2:31 pm
Ed Wagner (1/15/2014)
Steve Jones - SSC Editor (1/15/2014)
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
WOW! You've done quite a bit; no wonder you have a knee injury. Whatever you do, take the time to let it heal when your surgery is done. I'm curious...what style of karate did you study?
Taking time to heal will be tough. I'll go slow, and I'm good at that, but can't sit still.
Kenpo Karate.
January 15, 2014 at 2:32 pm
WayneS (1/15/2014)
Wow... I really sorry to hear about this. Sure hoping it heals fine, without issues, fast.
Thanks, but I'm fine. I've seen you 4 or 5 times with this. Just starting to really impact life, so need to get it fixed.
January 15, 2014 at 3:52 pm
Steve Jones - SSC Editor (1/15/2014)
Ed Wagner (1/15/2014)
Steve Jones - SSC Editor (1/15/2014)
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
WOW! You've done quite a bit; no wonder you have a knee injury. Whatever you do, take the time to let it heal when your surgery is done. I'm curious...what style of karate did you study?
Taking time to heal will be tough. I'll go slow, and I'm good at that, but can't sit still.
Kenpo Karate.
Make the time. You wouldn't be happy with a scooter.
That might actually make you complain.
You certainly aren't the 'poor me' type.
Hope it all goes well.
January 15, 2014 at 9:36 pm
Steve Jones - SSC Editor (1/15/2014)
Ed Wagner (1/15/2014)
Steve Jones - SSC Editor (1/15/2014)
WayneS (1/15/2014)
Steve Jones - SSC Editor (1/13/2014)
I'm hoping to get back to SQLBits this year, but with surgery coming, timing will matter. I hope they announce something soon.Steve, did I miss something here?
http://voiceofthedba.wordpress.com/2014/01/09/lemonade-and-life/
WOW! You've done quite a bit; no wonder you have a knee injury. Whatever you do, take the time to let it heal when your surgery is done. I'm curious...what style of karate did you study?
Taking time to heal will be tough. I'll go slow, and I'm good at that, but can't sit still.
Kenpo Karate.
We've never met, but I understand where you're coming from with the inability to sit still. I know people who have gone through ACL surgery and you have to take things slowly afterwards. They didn't have to stop anything except sports for a while and they're doing fine now, but they took the time to heal. Enjoy some indoor activities with your kids for a while. I hope the surgery goes well and you have a good outcome.
January 16, 2014 at 2:04 pm
Could I ask for another 'voice' on this thread? I'm hoping that another voice will phrase things in a different way that will help make sense to the OP. He's friendly and new and trying to learn, so please no dogpiles. 🙂
http://www.sqlservercentral.com/Forums/Topic1531363-364-1.aspx
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
January 21, 2014 at 8:59 am
Greg Edwards-268690 (1/15/2014)
Make the time. You wouldn't be happy with a scooter.That might actually make you complain.
You certainly aren't the 'poor me' type.
Hope it all goes well.
Thanks. I'm sure it will be fine, and I'll come back. I do go slow, just can't stop. Plus, I'm motivated. 7 months later my wife is still a little tentative with things, especially skiing. we are both hoping to have a good ski season next year. Not sure I'll get out in October, but I should be OK for November.
January 21, 2014 at 9:01 am
Ed Wagner (1/15/2014)
We've never met, but I understand where you're coming from with the inability to sit still. I know people who have gone through ACL surgery and you have to take things slowly afterwards. They didn't have to stop anything except sports for a while and they're doing fine now, but they took the time to heal. Enjoy some indoor activities with your kids for a while. I hope the surgery goes well and you have a good outcome.
Thanks. Now if I can get the kids to do some indoor stuff.
January 21, 2014 at 9:37 am
Steve Jones - SSC Editor (1/21/2014)
Ed Wagner (1/15/2014)
We've never met, but I understand where you're coming from with the inability to sit still. I know people who have gone through ACL surgery and you have to take things slowly afterwards. They didn't have to stop anything except sports for a while and they're doing fine now, but they took the time to heal. Enjoy some indoor activities with your kids for a while. I hope the surgery goes well and you have a good outcome.Thanks. Now if I can get the kids to do some indoor stuff.
Best of luck with that, especially if they are teenagers...
January 21, 2014 at 9:50 am
Revenant (1/21/2014)
Steve Jones - SSC Editor (1/21/2014)
Ed Wagner (1/15/2014)
We've never met, but I understand where you're coming from with the inability to sit still. I know people who have gone through ACL surgery and you have to take things slowly afterwards. They didn't have to stop anything except sports for a while and they're doing fine now, but they took the time to heal. Enjoy some indoor activities with your kids for a while. I hope the surgery goes well and you have a good outcome.Thanks. Now if I can get the kids to do some indoor stuff.
Best of luck with that, especially if they are teenagers...
12 and 15, and 21. 21 year old is the most likely to play cards or hang out with the parents.
January 21, 2014 at 10:50 am
Steve Jones - SSC Editor (1/21/2014)
Revenant (1/21/2014)
Steve Jones - SSC Editor (1/21/2014)
Ed Wagner (1/15/2014)
We've never met, but I understand where you're coming from with the inability to sit still. I know people who have gone through ACL surgery and you have to take things slowly afterwards. They didn't have to stop anything except sports for a while and they're doing fine now, but they took the time to heal. Enjoy some indoor activities with your kids for a while. I hope the surgery goes well and you have a good outcome.Thanks. Now if I can get the kids to do some indoor stuff.
Best of luck with that, especially if they are teenagers...
12 and 15, and 21. 21 year old is the most likely to play cards or hang out with the parents.
They state understanding parents and bond again when they reach about 27.
Viewing 15 posts - 42,601 through 42,615 (of 66,688 total)
You must be logged in to reply to this topic. Login to reply