Hacker News new | past | comments | ask | show | jobs | submit login

Here's the key point I think the article misses: Very nearly always (I mean really really nearly always), when you do a left/right/inner join, the condition you use for the join is a unique (usally primary) key on one side and a foreign key on the other side. So although in theory you start with the full cartesian join and then filter some of the results out (picking out of n×m entries), in practice you are only left with at most max(n,m) entries. So something like a Venn diagram is much less wrong than it is for the outer join (but still a bit wrong).

What I would like to see is inner/left/right joins explained with colours used to indicate value (as the article already does) but in the form of entries in a PivotTable (as the article used only for outer join), perhaps with faded entries for those that were filtered out. Most of all, it would be great to see this with non-unique values in both tables, as rare as this admittedly is. This could be followed up by the more usual primary key / foreign key combination. At that point it would be visually clear that only max(n,m) entries are left, so you could finish up by showing those evil Venn diagrams after all, with the disclaimer that you understand that there's a full n×m combination under the hood in theory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: