Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54

    Unanswered: SQL result set materialization process

    I know that I've read two good step-by-step descriptions of the process by which a SELECT statement is processed into a result set. One was written at the theoretical level for ISO standard SQL, and I'm pretty sure that Joe Celko wrote it. The second was a much more practical and "hands on" description for Microsoft SQL Server that I think was written by either Richard Waymire or Euan Garden.

    I'd really like to find the Microsoft specific discussion, but I can't for the life of me construct a query for any of the web search engines that will turn up either of these documents. Can anybody help me on this?

    -PatP

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i googled on "sequence of execution of query clauses" and so far found only this --some guy basically wants to know the same as you

    i found a few documents talking about the "sequence tree" but none of them mention the order of query clauses:
    • FROM
    • WHERE
    • GROUP BY
    • HAVING
    • SELECT
    • ORDER BY
    i do know of another article which discusses it:but it's not Microsoft-specific (in fact i wrote it based on the same stuff by celko that you must've read, which i'll be darned if i can find now...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    That's what I understand to be the theoretical RDBMS-independent order.

    If you study query plans you can infer that this is broadly the order of operations that SQL Server uses too.

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Google shmoogle. I am old fashioned and I keep these old things called books around. I find them relaxing.

    Chapter 1 Logical Query Processing
    Inside Microsoft SQL Server 2005: T-SQL Querying
    2005 Edition
    Itzik Ben-Gan
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I think Itzik needs to start paying you commission Sean

  6. #6
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Naaah, he just sits in my backpack with snacks and medicine waiting for me to get caught somewhere where I have no other means of diversion. I got through 2 of the other books in the series and halfway through 2 of the others and I have not touched the fifth.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •