Thread: Row vs. tuple

Row vs. tuple

From
Peter Eisentraut
Date:
In some places the documentation uses the term "tuple" to mean "row
version" (in the MVCC sense).  This choice of terms is puzzling me; where
does it come from?  In the literature available to me, the term "tuple" is
used as the mathematical equivalent of "row", meaning that
table/row/column parallels relation/tuple/attribute.  This terminology is
also used in other parts of PostgreSQL.  For example, libpq and derived
interfaces use "tuple" in function names to refer to rows.  Should we not
make this usage consistent?  I suggest we use "row version" when we mean
row version, which will also make things clearer to less experienced
users.

--
Peter Eisentraut   peter_e@gmx.net


Re: Row vs. tuple

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> In some places the documentation uses the term "tuple" to mean "row
> version" (in the MVCC sense).  This choice of terms is puzzling me; where
> does it come from?  In the literature available to me, the term "tuple" is
> used as the mathematical equivalent of "row", meaning that
> table/row/column parallels relation/tuple/attribute.

Well, "row version" isn't a particularly standard term either.  I'd
prefer a one-word term.  I think that the use of "tuple" for this can be
traced back to the Berkeley code.

I concede that it's not standard usage anyplace else ... but the whole
concept of row versions isn't real standard in most DBs.

(Anyone know what Oracle calls 'em?)

            regards, tom lane

Re: Row vs. tuple

From
Sean Chittenden
Date:
> > In some places the documentation uses the term "tuple" to mean
> > "row version" (in the MVCC sense).  This choice of terms is
> > puzzling me; where does it come from?  In the literature available
> > to me, the term "tuple" is used as the mathematical equivalent of
> > "row", meaning that table/row/column parallels
> > relation/tuple/attribute.
>
> Well, "row version" isn't a particularly standard term either.  I'd
> prefer a one-word term.  I think that the use of "tuple" for this can be
> traced back to the Berkeley code.

How about:  s/(row|tuple)/record/

A "record" is a much less theoretical/mathematical term that I've had
good success in using when describing basic table theory to lay
people.  Seems easier to grasp on the uptake than a row (rows are
confused with columns if you're not familiar with databases, math, or
matrices.  "Do rows go vertically or horizontally?") or tuple
(heavily mathematical term or term used in DB theory, but no where
else).  A record, on the other hand, is something that everyone has a
conceptual picture of.  -sc

--
Sean Chittenden

Re: Row vs. tuple

From
Tom Lane
Date:
Sean Chittenden <sean@chittenden.org> writes:
> How about:  s/(row|tuple)/record/

We do need two different terms: eliminating the distinction between a
row and a version of a row is not going to improve matters.

I have nothing against the word "record", but it doesn't seem to help
clarify this distinction ...

            regards, tom lane

Re: Row vs. tuple

From
Sean Chittenden
Date:
> > How about:  s/(row|tuple)/record/
>
> We do need two different terms: eliminating the distinction between
> a row and a version of a row is not going to improve matters.
>
> I have nothing against the word "record", but it doesn't seem to
> help clarify this distinction ...

Well, if you want to get cognitive, "old record" likely carries a more
explicit and easy to understand mental picture than "old tuple" or
"version of a row."  I guess the same phrasing could apply to tuple or
row, but record has historically seemed like the easiest term for
people to grasp.

  (new|old)? (record|row|tuple)

It's not a one word zinger, but (new|old)? is just a description for
the entity that the mind has an understanding or conceptupal picture
of.  -sc

--
Sean Chittenden

Re: Row vs. tuple

From
Peter Eisentraut
Date:
Tom Lane writes:

> Well, "row version" isn't a particularly standard term either.  I'd
> prefer a one-word term.

I think "row version" is the only logical and self-explanatory term that
can be derived from "row" and "multiversion concurrency control".  And
even though it's two words, it's just as short as most other terms we
could come up with.  But more importantly, it should get the message
across to most users, while most other suggestions would simply be another
ambiguous word.

> (Anyone know what Oracle calls 'em?)

I don't think Oracle really has this concept, because their
multiversioning is not implemented with a nonoverwriting storage manager.

--
Peter Eisentraut   peter_e@gmx.net


Re: Row vs. tuple

From
Hannu Krosing
Date:
Tom Lane kirjutas L, 15.03.2003 kell 23:31:
> Sean Chittenden <sean@chittenden.org> writes:
> > How about:  s/(row|tuple)/record/
>
> We do need two different terms: eliminating the distinction between a
> row and a version of a row is not going to improve matters.

For me "row version" is a nice, self-explaining term. There is very
little chance that you will misake it for anything else, from whatever
culture (math,db,bean-counting,hardware hacking,...) you come from.

Tuple and record are both already loaded with several different and
contradicting meanings.

> I have nothing against the word "record", but it doesn't seem to help
> clarify this distinction ...

True.

-----------
Hannu