July 24, 2012 at 6:58 am
Nice. Thanks for the question kranthi1.aprdc!
July 24, 2012 at 7:03 am
Dalton Moore (7/24/2012)
At least I was not the only one who noticed the first and third option were the same...
I didn't bother reading the first or third as they don't begin with From.
+1
Cheers,
Steve
July 24, 2012 at 8:56 am
Thanks for easy back-to-basics question!
July 24, 2012 at 9:28 am
Thanks for the question - cheers
+1 on this being especially easy given the answers to choose from!
July 24, 2012 at 9:46 am
Thomas Abraham (7/24/2012)
Thanks kranthi1.aprdc for the question. I see you are relatively new to the site. So good to see you jumping in with a QotD contribution. As others have suggested, this one might have been a bit too easy, with only one answer that started with "FROM". But, you're pointed in the right direction.
Agreed. Great topic, and a very helpful area for study.
Rob Schripsema
Propack, Inc.
July 24, 2012 at 9:49 am
sreepathi1987 (7/24/2012)
Simple question.....Is any answer verification doing before posting the questions ?
not really...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 24, 2012 at 9:50 am
Nice question, thanks.
July 24, 2012 at 12:29 pm
Jamsheer (7/23/2012)
Thanks for the easy point.. I think the first and last options given are same..
They were the same. Made it a bit easier 😉
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
July 24, 2012 at 2:51 pm
Easy one!
July 25, 2012 at 7:28 pm
Good one should have included DISTINCT to make it more confusing.
July 27, 2012 at 1:40 pm
Good straightforward question.
But in the explanation: is that really the parsing order, or are you assuming that's the parsing order because it's the execution order? I don't think I've seen any documentation on MS's parsing order for T-SQL. It does seem a fairly reasonable parsing order though.
Tom
July 27, 2012 at 1:41 pm
SQLRNNR (7/24/2012)
Jamsheer (7/23/2012)
Thanks for the easy point.. I think the first and last options given are same..They were the same. Made it a bit easier 😉
I didn't read beyond "select" in either of them, because I knew they were incorrect as soon as I saw select was first.
Tom
August 8, 2012 at 6:10 am
L' Eomot Inversé (7/27/2012)
Good straightforward question.But in the explanation: is that really the parsing order, or are you assuming that's the parsing order because it's the execution order? I don't think I've seen any documentation on MS's parsing order for T-SQL. It does seem a fairly reasonable parsing order though.
Yes I think you're right. It is logically parsed that way. Doesn't the optimizer rearrange it to produce the most efficient plan for retrieving the data? So looking at an execution plan you can see where it will sometimes think it more efficient to group by first then filter on the Where Clause or it may filter on one expression in the where clause and then later hit another.
That's probably why they can't list an execution order because the optimizer determines the parsing order by costs and statistics (could be out of date).
"There is nothing so useless as doing efficiently that which should not be done at all." - Peter Drucker
August 8, 2012 at 6:18 am
charles.byrne (8/8/2012)
L' Eomot Inversé (7/27/2012)
Good straightforward question.But in the explanation: is that really the parsing order, or are you assuming that's the parsing order because it's the execution order? I don't think I've seen any documentation on MS's parsing order for T-SQL. It does seem a fairly reasonable parsing order though.
Yes I think you're right. It is logically parsed that way.
No, that is not true. Parsing (processing the string of characters into internnal symbols to represent the actual query) is not documented, but I don't think it's even possible to write a parser that doesn't operate either left-to-right or right-to-left.
It's also not the actual order of execution since, as you mention, the optimizer is free to choose any execution plan that returns the correct results.
The order of execution documented in Books Online is usually referred to as the "logical order of execution". It is what defines the correct results of the query. Basically, the result of any query can be described based on this order of execution. If you always follow this order, you will always get the correct results (but probably not always very fast). Any change made by the optimizer must guarantee that the results are still AS IF this order has been followed.
August 8, 2012 at 11:42 am
Very easy question!
Viewing 15 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply