Re: Join types

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Fri, 25 Jan 2008 21:06:09 -0800
Message-ID: <13plfu3t0du519f_at_corp.supernews.com>


Bob Badour wrote:

> JOG wrote:

>> On Jan 25, 11:04 am, Gints Plivna <gints.pli..._at_gmail.com> wrote:
>>> I'm a bit studying join types and trying to make a visualisation of
>>> relations among them. As a result I've created an ER diagram
>>> describing relations among them and it can be found
>>> here: http://gplivna.blogspot.com/2008/01/sql-join-types-im-studying-bit-sq...
>>>
>>> I've tried to find something like that using google however the best I
>>> could get was textual description. I'm not mathematician and studied
>>> set theory a bit 10 years ago in university and almost all have no
>>> forgotten :) so maybe it has some problems from set theory viewpoint.
>>> So question is - is it generally ok? If you know anything similar
>>> please add link either here or in my blog post. All comments welcome!
>>> Thanks!
>>> Gints
>>
>> Having only looked at your breakdown briefly, I can't give you much
>> comment (although I thought your time-bomb discussion of natural joins
>> was entertaining). However, I would say that in general I view natural
>> joins, equi-joins, etc. as specializations of the generalized theta
>> join. I'd be interested if other's share this perspective.
> 
> I do not share the perspective. I prefer to view theta join as natural 
> join followed by restrict.

Can you explain how that works? I can see theta join as cartesian product followed by restrict, but I don't see how you do a 'greater than' join with a natural join -- unless you rename one (or both) of the join terms so that natural join degenerates into cartesian product and then you restrict on the renamed terms. But that's not an obvious use of a natural join, I think.

> One might argue it's just a question of one's choice of primitives. I 
> would argue that both natural join and restrict are simpler operations 
> than theta join.


-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com Guardian of DBD::Informix v2007.0914 -- http://dbi.perl.org/

publictimestamp.org/ptb/PTB-2365 sha512 2008-01-26 03:00:05 AB90FEBA17BC6DD2B41824F751D70E037E6DC63C810FF209B17E01B7883E9DFB1D6E34 51F56B1991A26C63BECE9CBC0C696517C3EE4F0B0C9056723D17F3EDE Received on Sat Jan 26 2008 - 06:06:09 CET

Original text of this message