|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:59 AM
Points: 1,126,
Visits: 924
|
|
Great question for learning - cheers 
And, more importantly, congrats on winning the Webb Ellis, SQL Kiwi!
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 3:48 AM
Points: 3,125,
Visits: 4,311
|
|
Good question - got it wrong, but learned a great deal from it. Thanks, Paul.
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:24 AM
Points: 5,235,
Visits: 7,040
|
|
Good question, Paul!
I had the correct answer,but only thanks to the fact that I attended SQL Saturday in Portland a few weeks back (just before the PASS Summit). I don't recall who said it, probably either Buck or Rob, but the quote itself will always stick: "Exection plans suck". Refering to the little-known fact that data is not pushed from right to left (as most people usually read plans, myself included), but pulled ("sucked") by the top-left operator from the operator to the right and below it.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, October 24, 2012 8:17 PM
Points: 1,558,
Visits: 247
|
|
Tough question with good references. I missed it but I learned something today.
http://brittcluff.blogspot.com/
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 10:51 AM
Points: 1,219,
Visits: 13,507
|
|
really, it's a very good question!!!
thanks Paul!!
rfr.ferrari DBA - SQL Server 2008 MCITP | MCTS
remember is live or suffer twice!
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 5:02 AM
Points: 1,149,
Visits: 1,451
|
|
tommyh (10/27/2011) Yes the stream aggregate gets called first... but it hasnt finished. So is the important part which gets called first or which gets finished first? Personally i think its the part that gets finished first thats important (or more precisly the thing that performs its purpose first). I cant say a function has been executed when it hasnt actually done anything.
Got it wrong because I just parroted something I picked up from this site. Moving a little fast this morning.
However, while I have no quibble with the explanation, I think I prefer Tommy's point of view semantically. I tend to think of "Execute" in terms of completion. The example that came to mind was a recursive call. Although the first call starts "executing" first, it can't complete its business until all subsequent calls have completed.
Thanks to SQL Kiwi for the question.
Please don't go. The drones need you. They look up to you.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:44 PM
Points: 1,786,
Visits: 3,323
|
|
Hugo Kornelis (10/27/2011) "Exection plans suck". Refering to the little-known fact that data is not pushed from right to left (as most people usually read plans, myself included), but pulled ("sucked") by the top-left operator from the operator to the right and below it.Excellent explanation Hugo  Oh, and I got the question wrong.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, November 08, 2011 7:12 AM
Points: 2,
Visits: 27
|
|
tommyh (10/27/2011)
Yes the stream aggregate gets called first... but it hasnt finished. So is the important part which gets called first or which gets finished first? Personally i think its the part that gets finished first thats important (or more precisly the thing that performs its purpose first). I cant say a function has been executed when it hasnt actually done anything. Could be a language thing though that i put a different meaning into "executes" then everyone else  /T
I agree with tommy on this one. The question is a bit flawed. If you are attempting to teach the reader that the plan started with the left-most operation, then ask that in the question. Otherwise, you are attempting to bait the reader (unintentionally of course) into choosing the meaning of 'executes first'.
Nonetheless, the links are great ones to read and understand.
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:29 AM
Points: 4,804,
Visits: 8,067
|
|
ksummerlin-532910 (10/27/2011)
tommyh (10/27/2011)
Yes the stream aggregate gets called first... but it hasnt finished. So is the important part which gets called first or which gets finished first? Personally i think its the part that gets finished first thats important (or more precisly the thing that performs its purpose first). I cant say a function has been executed when it hasnt actually done anything. Could be a language thing though that i put a different meaning into "executes" then everyone else  /T I agree with tommy on this one. The question is a bit flawed. If you are attempting to teach the reader that the plan started with the left-most operation, then ask that in the question. Otherwise, you are attempting to bait the reader (unintentionally of course) into choosing the meaning of 'executes first'. Nonetheless, the links are great ones to read and understand.
Although I got it wrong, I disagree with you.
In this code, what executes first?
function main(){ return sayHello() + " " + sayWorld() }
function sayHello(){ return "Hello" }
function sayWorld(){ return "World" }
I think it's not hard at all to identify the function that executes first in this pseudo-code fragment. I'm sure that Paul wants us to get away with this concept.
Get your two-cent-answer quickly The Spaghetti DBA
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 8:49 AM
Points: 2,672,
Visits: 2,417
|
|
| Tough question. Good learning opportunity. Thanks Paul.
|
|
|
|