[prev] 28 [next]

Exercise 4: PostgreSQL Tuple Visibility

Due to MVCC, PostgreSQL's getTuple(b,i) is not so simple
  • ith tuple in buffer b may be "live" or "dead" or ... ?
How does PostgreSQL recognise "dead" tuples?

What possible states might tuples have?

Assume: multiple concurrent transactions on tables.

Hint: tuple = (oid,xmin,xmax,...rest of data...)

Hint: include/access/htup.h

Hint: backend/utils/time/tqual.c