Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. What is merge join in sql server

What is merge join in sql server

Scheduled Pinned Locked Moved Database
questiondatabasesql-serversysadmincryptography
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tridip Bhattacharjee
    wrote on last edited by
    #1

    what is merge and hash join ? if anyone know and use it then please share the knowledge. when one should go for merge and hash join. if possible discuss it with a good example the significance of merge and hash join. also tell me how merge and hash join is different from normal join thanks

    tbhattacharjee

    C 1 Reply Last reply
    0
    • T Tridip Bhattacharjee

      what is merge and hash join ? if anyone know and use it then please share the knowledge. when one should go for merge and hash join. if possible discuss it with a good example the significance of merge and hash join. also tell me how merge and hash join is different from normal join thanks

      tbhattacharjee

      C Offline
      C Offline
      CHill60
      wrote on last edited by
      #2

      Google is a wonderful resource for questions like this...Google[^] In the meantime have a read of this article : Join Operations – Hash Match - SQLServerCentral[^]

      L T 2 Replies Last reply
      0
      • C CHill60

        Google is a wonderful resource for questions like this...Google[^] In the meantime have a read of this article : Join Operations – Hash Match - SQLServerCentral[^]

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        CHill60 wrote:

        Google is a wonderful resource

        OP is pathologically averse to using Google. Maybe it's a rude word in his language.

        C 1 Reply Last reply
        0
        • C CHill60

          Google is a wonderful resource for questions like this...Google[^] In the meantime have a read of this article : Join Operations – Hash Match - SQLServerCentral[^]

          T Offline
          T Offline
          Tridip Bhattacharjee
          wrote on last edited by
          #4

          searching google for merge join in sql server brings lots of result but i like to know when it is good or should i do it when joining one key is pk or other key is fk or regular key. in this kind of scenario merge join in sql server will be good. share your idea if you know. thanks

          tbhattacharjee

          C L 2 Replies Last reply
          0
          • T Tridip Bhattacharjee

            searching google for merge join in sql server brings lots of result but i like to know when it is good or should i do it when joining one key is pk or other key is fk or regular key. in this kind of scenario merge join in sql server will be good. share your idea if you know. thanks

            tbhattacharjee

            C Offline
            C Offline
            CHill60
            wrote on last edited by
            #5

            This article (from the first page of the Google search I posted) sums it up pretty well Understanding SQL Server Physical Joins[^] I draw your attention to the statement at the end of the article

            Quote:

            SQL Server does a pretty good job in deciding which join operator to use in each condition. Understanding these condition helps you to understand what can be done in performance tuning. It's not recommended to use join hints (using OPTION clause) to force SQL Server to use a specific join operator (unless you have no other way out), but rather you can use other means like updating statistics, creating indexes or re-writing your query.

            Given the way you have worded your question I would just stick to using normal join syntax and allow SQL Server to do the decisions on how they are physically implemented. These resources may be helpful: SQL Server Join Example[^] Visual Representation of SQL Joins[^]

            1 Reply Last reply
            0
            • L Lost User

              CHill60 wrote:

              Google is a wonderful resource

              OP is pathologically averse to using Google. Maybe it's a rude word in his language.

              C Offline
              C Offline
              CHill60
              wrote on last edited by
              #6

              I see what you mean :doh:

              1 Reply Last reply
              0
              • T Tridip Bhattacharjee

                searching google for merge join in sql server brings lots of result but i like to know when it is good or should i do it when joining one key is pk or other key is fk or regular key. in this kind of scenario merge join in sql server will be good. share your idea if you know. thanks

                tbhattacharjee

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Tridip Bhattacharjee wrote:

                searching google for merge join in sql server brings lots of result but i like to know when it is good or should i do it when joining one key is pk or other key is fk or regular key.

                Try reading the first pages that come back as a result :|

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups