r
is supposed to stand for any relation value/instance of schema R
(that is losslessly decomposable). But even if a relation value is losslessly decomposable, we must pay attention to which (sets of) attributes we decompose into.
The more important question: what are R1
, R2
?
Your quote is perhaps based on the wikipedia article or one of the links from it -- which appears to be almost complete garbage; far worse than wikipedia's usual standard on Relational Model topics. (For example it shows a cartesian product to recompose the projections -- whereas a lossless join usually requires a join: the bowtie operator, as you show.)
Operator π is the Relational Algebra projection. π is usually shown subscripted with an attribute name (or more properly a set of attribute names). And those are usually symbolised by X, Y
or similar. Then R1
, R2
should be sets of attribute names, not relations. They certainly can't be both. (All I can imagine is that R1, R2
are intended to stand for the schemas/sets of attributes of the two relations.)
Furthermore for lossless join decomposition, we require the two projections together to include all the attributes of R
. (And typically some attributes in common so that the join matches together.)
So we should have
r1 = πX(r) -- r1 is the value of R1 corresponding to r
r2 = πY(r) -- ditto for R2
attributes of R = X ∪ Y -- intersection of X, Y not necessarily empty
r = r1 ⋈ r2
A clear example is where R
has attributes {A, B, C}
and {A}
is a key. Then we can decompose as X = {A, B}, Y = {A, C}
.