Does SQL table join order matter?

Sdílet
Vložit
  • čas přidán 21. 07. 2024
  • Have you ever wondered if the order of the tables in your FROM clause matter?
    In today's video, we look at why theoretically table join order does make a difference for performance and why SQL Server doesn't use the order you provide.
    We also look at different techniques for forcing SQL Server to use the join order you specified.
    Blog post with all demo code and links:
    bertwagner.com/2017/11/21/doe...
    Presentation by Adam Machanic on row goals:
    sqlbits.com/Sessions/Event14/...
    Music by Joakim Karud / joakimkarud
    Follow me on Twitter:
    / bertwagner
    Want to receive my latest weekly blog posts and videos in your inbox? Sign up for the newsletter here: upscri.be/c77fc8/
  • Věda a technologie

Komentáře • 16

  • @American5585
    @American5585 Před 5 lety +4

    so happy I could find advanced SQL channel. Keep it up!

  • @RomanPeralta
    @RomanPeralta Před 3 lety +2

    I wish I would have found this amazing channel before. You rock Bert!

  • @vitor613
    @vitor613 Před 4 lety +3

    That is exactly was I was searching for. Thank you!

  • @osPA78
    @osPA78 Před 6 lety +1

    Great explanation on JOIN orders. Definitely learned a good amount from you video! Thank you!!!

  • @sabuein
    @sabuein Před rokem

    Thank you, Bert, very much.

  • @verokster
    @verokster Před 2 lety

    Great explanation and tricks. Thank you

  • @ironknight132
    @ironknight132 Před rokem

    Thank you sir! Helpful video!

  • @kirankumarkommalapudi9947

    Thanks for sharing.

  • @nsrchndshkh
    @nsrchndshkh Před 3 lety

    Thanks Man for the explanation

  • @BeRNisira
    @BeRNisira Před 3 lety

    thanks for your videos!

  • @youyilin6592
    @youyilin6592 Před 4 lety

    Thanks Bert!!!

  • @purnachandrak2148
    @purnachandrak2148 Před 5 lety

    Nice vedio bert, can you make a vedio on execution plans.

  • @NoFeetOnEarth
    @NoFeetOnEarth Před 5 lety

    Great vid indeed! Would you be able to answer a question i've asked myself for a while, but no expert I could ask to?
    I've read an index can only used once for a query, does that mean for only 1 join, even if multiple different joins could use this index?

    • @NoFeetOnEarth
      @NoFeetOnEarth Před 5 lety

      @@DataWithBert Hi Bert, thanks for the reply, this is actually never happening :D
      You're right, my question was not clear.
      What I am referring to is the following statement "SQL Server can use only one index for each table that is present in the query".
      What does that mean exactly?
      Also, if the table is present in a join and also in the WHERE clause, is it considered the same "join" or the WHERE clause is separated from the other joins that use the tables?
      Thanks in advance

  • @marcosoliveira8731
    @marcosoliveira8731 Před 3 lety +1

    That´s it.
    +1

  • @sharathsreedhar3153
    @sharathsreedhar3153 Před 4 lety +3

    Good video. Please lose the background Music(noise).