作者:瀚高PG实验室 (Highgo PG Lab)- 海无涯
接触postgresql的工程师会经常接触一个词——tuple
那么,什么事tuple呢?它的定义是什么呢?又有什么作用?该如何使用呢?
来看一下pg官方社区的一些看法:
1、It seems to be related deeply to the structure of postgres somehow.
2、I know what a tuple is but it seems like a word to impress more than inform.
3、A tuple is actually what it is. not meant to impress, but just what
it is. a tuple is defined as “a data object containing two or more
components”.
附加连接:
https://www.postgresql.org/message-id/20020628092449.B28070@metalico.drauku.net
首先我们应该知道PG并没有像Oracle那样的undo来存放旧数据,而且PG没有真正意义上的delete,而是将旧版本直接存放于relation文件中,也就是成为了dead tuple。我们可以理解成“过期的数据”
tuple就相当于一个存储数据的小容器,它包含了两个及以上的components。在我们看来,它可能会与Oracle中的row类似,但是这二者之间并不能划等号。