Friday, March 30, 2012

Merge Join

I am trying to understand mege joins. In BOL it reads "The merge join
requires that both inputs be sorted on the merge columns, which are defined
by the equality (WHERE) clauses of the join predicate."
What does it mean "both inputs must be sorted"?
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200603/1> What does it mean "both inputs must be sorted"?
That you on each table either have a clustered index on the columns over which you do the join, or a
non-clustered index that covers the data that is needed from the table.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"cbrichards via SQLMonster.com" <u3288@.uwe> wrote in message news:5d9898960f213@.uwe...
>I am trying to understand mege joins. In BOL it reads "The merge join
> requires that both inputs be sorted on the merge columns, which are defined
> by the equality (WHERE) clauses of the join predicate."
> What does it mean "both inputs must be sorted"?
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200603/1

No comments:

Post a Comment