Forum Moderators: open

Message Too Old, No Replies

Left Semi Join

         

john_k

2:10 pm on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LEFT SEMI JOIN

I ran across this in the Transact SQL help files and can't find much more information about it. The help file doesn't really shed much light on it. Nor does Microsoft's website. I found some whitepapers on how to implement it into an RDBMS and why it is good to use it, but I'm not creating a new RDBMS, so that doesn't help either.

I was about to just forget about it when I noticed the LEFT ANTI SEMI JOIN operator listed. So now I have to know a little more about it.

Can anyone explain this a little and is it something that is actually implemented in MS SQL Server?

Easy_Coder

1:34 am on Sep 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From MS SQL Books Online:

Left Semi Join

The Left Semi Join logical operator returns each row from the first (top) input when there is a matching row in the second (bottom) input. If no join predicate exists in the Argument column, each row is a matching row.

john_k

5:39 pm on Sep 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From MS SQL Books Online:
Left Semi Join

The Left Semi Join logical operator returns each row from the first (top) input when there is a matching row in the second (bottom) input. If no join predicate exists in the Argument column, each row is a matching row.


That's identical to what is in the Transact SQL help that I referred to. So, if you wanted to actually utilize a LEFT SEMI JOIN, this is fairly useless information.

I am guessing that MS documents it for reference only, and that it is not implemented in SQL server. From other information I have read since my original post, the SEMI JOINs are useful when joining across different (distributed) databases. They work to minimize the amount of data that must be transported to the processing server in order to execute a join on a remote table.

Easy_Coder

6:26 pm on Sep 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We'll my dev version of SQL Server: (Microsoft SQL Server 2000 - 8.00.194 (Intel X86) Aug 6 2000 00:57:48 Copyright (c) 1988-2000 Microsoft Corporation Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 1))

Does not recognize semi as a join option. Here's my error msg:
Server: Msg 155, Level 15, State 1, Line 5
'Semi' is not a recognized join option.

Does your version recognize it?

Easy_Coder

6:34 pm on Sep 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



john_k, I wonder if this is available to the system only. In little bit of research I've done I can only see LEFT SEMI JOIN available in the Execution Plans?

john_k

6:56 pm on Sep 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does your version recognize it?

No, I tried a few variations on it before I posted here. I got a similar error message.

john_k, I wonder if this is available to the system only. In little bit of research I've done I can only see LEFT SEMI JOIN available in the Execution Plans?

That would make sense. Since it is only applicable to a distributed query, the optimizer may utilize the SEMI joins when joining across database servers.