What is merge join in sql server
-
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
-
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
-
Google is a wonderful resource for questions like this...Google[^] In the meantime have a read of this article : Join Operations – Hash Match - SQLServerCentral[^]
-
Google is a wonderful resource for questions like this...Google[^] In the meantime have a read of this article : Join Operations – Hash Match - SQLServerCentral[^]
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
-
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
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[^]
-
CHill60 wrote:
Google is a wonderful resource
OP is pathologically averse to using Google. Maybe it's a rude word in his language.
-
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
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)