December 15, 2010 at 1:11 am
Craig Farrell (12/14/2010)
WayneS (12/14/2010)
Gail, are you trying for sainthood?Yeah, she is.
First step to become asaint is to get beatified.
If guess that certainly will not be a problem :hehe:
Say 5 "hail Gail"s and one "our SQL" for salvation :w00t:
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 15, 2010 at 1:16 am
Brandie Tarvin (12/14/2010)
CirquedeSQLeil (12/14/2010)
What's so bad about going to bed? 😉Haven't you heard? Sleeping on the job is a capital offense. You can be sued for posting about it on an open forum. @=)
Ah, BrE and AmE are such amusingly different languages. In Right-Pondia you can be fired for being on the job at work.
Like Gus, I can't fully explain that in this family forum.
Tom
December 15, 2010 at 1:57 am
WayneS (12/14/2010)
Gail, are you trying for sainthood?
No. You have to be dead to become a saint. Doesn't sound appealing.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 15, 2010 at 2:02 am
GilaMonster (12/15/2010)
WayneS (12/14/2010)
Gail, are you trying for sainthood?No. You have to be dead to become a saint. Doesn't sound appealing.
tsss, details ... details... :hehe:
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 15, 2010 at 2:18 am
CirquedeSQLeil (12/14/2010)
Does this frighten anybody else?
No kidding. Reminds me of Dr Who from the 70's when it was truly scary. We've recently had a sofa installed right near my workstation, the temptation to hide behind it was almost overwhelming :w00t:
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
December 15, 2010 at 2:21 am
Stefan Krzywicki (12/14/2010)
I had an idea about the problem I mentioned earlier and I just wanted a quick sanity check.If I run the process with around 15 days in the date range, I get acceptable speeds: 3 to 12 minutes.
If I run the process with 30 days, I get speeds of 2 to 4 hours.
I used to run the process with a third of a year at a time at speeds of an hour or two per query.
Sometime since then, my boss implemented resource limiting on the machine, keeping me from using all the RAM. Is this the kind of effect you'd see from that or is that not likely related? It seems to me that it would be, but I wanted to check with people that know this area better than I do.
Stefan, have you tried the variant WHERE EXISTS (SELECT 1 FROM...) yet?
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
December 15, 2010 at 2:31 am
Chris Morris-439714 (12/15/2010)
Stefan Krzywicki (12/14/2010)
I had an idea about the problem I mentioned earlier and I just wanted a quick sanity check.If I run the process with around 15 days in the date range, I get acceptable speeds: 3 to 12 minutes.
If I run the process with 30 days, I get speeds of 2 to 4 hours.
I used to run the process with a third of a year at a time at speeds of an hour or two per query.
Sometime since then, my boss implemented resource limiting on the machine, keeping me from using all the RAM. Is this the kind of effect you'd see from that or is that not likely related? It seems to me that it would be, but I wanted to check with people that know this area better than I do.
Stefan, have you tried the variant WHERE EXISTS (SELECT 1 FROM...) yet?
Nope. It really seems to be a resource issue. If I keep the return set small enough it goes quickly. If the return set gets too large it drops way off. I'm going to talk to my boss about the resource limiting and see if that makes a difference
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
It’s unpleasantly like being drunk.
What’s so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
December 15, 2010 at 4:07 am
Stefan Krzywicki (12/14/2010)
Wow. I was having problems with an older query taking too long, so I made what I thought was a little switch to begin making time improvements. I changed
FT INNER JOIN (SELECT TypeID FROM AllTypes WHERE ParentType = 1) T
ON FT.TypeID = T.TypeID
to
WHERE FT.TypeID IN (SELECT TypeID FROM AllTypes WHERE ParentType = 1)
I thought I'd get a decent improvement, but the query went from 2 hours to 5 minutes! I had no idea it would be that dramatic. Thank you SQL Server Saturday where I first learned that concept.
Those two query forms are semantically different: they're answering different questions, and will produce different results if AllTypes contains any duplicate values for TypeID. If TypeID has a unique constraint, the second form is a semi-join, which could equally be expressed using EXISTS, as Chris mentioned.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
December 15, 2010 at 5:05 am
Paul White NZ (12/15/2010)
Stefan Krzywicki (12/14/2010)
Wow. I was having problems with an older query taking too long, so I made what I thought was a little switch to begin making time improvements. I changed
FT INNER JOIN (SELECT TypeID FROM AllTypes WHERE ParentType = 1) T
ON FT.TypeID = T.TypeID
to
WHERE FT.TypeID IN (SELECT TypeID FROM AllTypes WHERE ParentType = 1)
I thought I'd get a decent improvement, but the query went from 2 hours to 5 minutes! I had no idea it would be that dramatic. Thank you SQL Server Saturday where I first learned that concept.
Those two query forms are semantically different: they're answering different questions, and will produce different results if AllTypes contains any duplicate values for TypeID. If TypeID has a unique constraint, the second form is a semi-join, which could equally be expressed using EXISTS, as Chris mentioned.
It contains no duplicate values. Is there any difference in using EXISTS in that case?
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
It’s unpleasantly like being drunk.
What’s so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
December 15, 2010 at 5:09 am
Any advise on doing presentations (the thing, not the content) ?
http://www.sqlservercentral.com/Forums/Topic1034954-61-1.aspx
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
December 15, 2010 at 5:14 am
Stefan Krzywicki (12/15/2010)
Paul White NZ (12/15/2010)
Stefan Krzywicki (12/14/2010)
Wow. I was having problems with an older query taking too long, so I made what I thought was a little switch to begin making time improvements. I changed
FT INNER JOIN (SELECT TypeID FROM AllTypes WHERE ParentType = 1) T
ON FT.TypeID = T.TypeID
to
WHERE FT.TypeID IN (SELECT TypeID FROM AllTypes WHERE ParentType = 1)
I thought I'd get a decent improvement, but the query went from 2 hours to 5 minutes! I had no idea it would be that dramatic. Thank you SQL Server Saturday where I first learned that concept.
Those two query forms are semantically different: they're answering different questions, and will produce different results if AllTypes contains any duplicate values for TypeID. If TypeID has a unique constraint, the second form is a semi-join, which could equally be expressed using EXISTS, as Chris mentioned.
It contains no duplicate values. Is there any difference in using EXISTS in that case?
I'd guess not - EXISTS wins when there are many matching rows because the process stops when it finds just one in the target. I *think* Gail has blogged on this, will look.
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
December 15, 2010 at 5:26 am
Chris Morris-439714 (12/15/2010)
I *think* Gail has blogged on this, will look.
http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/
http://sqlinthewild.co.za/index.php/2010/01/12/in-vs-inner-join/
http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/
http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/
http://sqlinthewild.co.za/index.php/2010/04/27/in-exists-and-join-a-roundup/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 15, 2010 at 5:28 am
GilaMonster (12/15/2010)
Chris Morris-439714 (12/15/2010)
I *think* Gail has blogged on this, will look.http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/
http://sqlinthewild.co.za/index.php/2010/01/12/in-vs-inner-join/
http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/
http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/
http://sqlinthewild.co.za/index.php/2010/04/27/in-exists-and-join-a-roundup/
Wow. It's like Gail has indexed her blog or something... @=)
December 15, 2010 at 5:29 am
GilaMonster (12/15/2010)
Chris Morris-439714 (12/15/2010)
I *think* Gail has blogged on this, will look.http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/
http://sqlinthewild.co.za/index.php/2010/01/12/in-vs-inner-join/
http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/
http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/
http://sqlinthewild.co.za/index.php/2010/04/27/in-exists-and-join-a-roundup/
Heh cheers Gail 🙂
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
December 15, 2010 at 6:20 am
GilaMonster (12/15/2010)
Chris Morris-439714 (12/15/2010)
I *think* Gail has blogged on this, will look.http://sqlinthewild.co.za/index.php/2009/08/17/exists-vs-in/
http://sqlinthewild.co.za/index.php/2010/01/12/in-vs-inner-join/
http://sqlinthewild.co.za/index.php/2010/02/18/not-exists-vs-not-in/
http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/
http://sqlinthewild.co.za/index.php/2010/04/27/in-exists-and-join-a-roundup/
So that is a "yes" then? : -)
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
It’s unpleasantly like being drunk.
What’s so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
Viewing 15 posts - 22,456 through 22,470 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply