The Order of Processing

  • Comments posted to this topic are about the item The Order of Processing

  • Back to basics, thanks Steve

    ...

  • Good to see 90% got it right so far.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • A good refresher, Thanks Steve

  • I'm curious about ON.  Is that referring to the columns used in the JOIN?  If so, why would that be before the JOIN?


    [font="Tahoma"]Personal blog relating fishing to database administration:[/font]

    [font="Comic Sans MS"]https://davegugg.wordpress.com[/url]/[/font]

  • My thoughts exactly (I came here to see if anyone had commented yet).  My assumption is that the ON is deciding what to join and how, and then the JOIN applies LEFT/RIGHT/INNER/OUTER/CROSS.

  • Thanks Steve, an interesting article, but it does rather contradict the order given in your answer.  You have FROM, ON, JOIN..., but in figure 4 in Ben-Gan's article it has JOIN->ON (or rather it just has JOIN, with ON as the second step in the JOIN).

  • Nice, simple question, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Andrew Watson-478275 - Friday, September 1, 2017 2:52 AM

    Thanks Steve, an interesting article, but it does rather contradict the order given in your answer.  You have FROM, ON, JOIN..., but in figure 4 in Ben-Gan's article it has JOIN->ON (or rather it just has JOIN, with ON as the second step in the JOIN).

    I think the ON is processed first, to determine how to apply the join based on indexes. Itzik has grouped them, while MS has separated them. In his book, he listed ON as coming before JOIN, but in revisions he's combined them in a step, perhaps because JOIN v ON doesn't practically matter? Not sure.

  • Steve Jones - SSC Editor - Friday, September 1, 2017 9:48 AM

    Andrew Watson-478275 - Friday, September 1, 2017 2:52 AM

    Thanks Steve, an interesting article, but it does rather contradict the order given in your answer.  You have FROM, ON, JOIN..., but in figure 4 in Ben-Gan's article it has JOIN->ON (or rather it just has JOIN, with ON as the second step in the JOIN).

    I think the ON is processed first, to determine how to apply the join based on indexes. Itzik has grouped them, while MS has separated them. In his book, he listed ON as coming before JOIN, but in revisions he's combined them in a step, perhaps because JOIN v ON doesn't practically matter? Not sure.

    I believe that before you do anything, you have to find what data you are working with, so for me it was a no-brainer. Thanks, Steve!

  • It's a very important point in understanding how SQL works as a declarative language. Down to 84% correct, but still a good percentage.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply