[prev] 50 [next]

Exercise 4: Implement next_tuple()

Consider the following possible Scan data structure

typedef struct {
   Relation rel;
   Page     *curPage;  // Page buffer
   int      curPID;    // current pid
   int      curTID;    // current tid
} ScanData;

Assume tuples are indexed 0..nTuples(p)

Assume pages are indexed 0..nPages(rel)

Implement the  Tuple next_tuple(Scan)  function

P.S. What's in a Relation object?