[prev] 54 [next]

Operations on Records

Simplest operation to access a record via its RID:

Record get_record(RecordId rid) {
    Page buf = request_page(relId(rid), pageNum(rid));
    return get_record_from_page(buf, recNum(rid));
}

where  TupleId = RecordId = (RelId, PageNum, TupIndex)

Gives a sequence of bytes, which needs to be "tuple-fied", e.g.

Record r = get_record(rid)
Tuple t = makeTuple(rel,rec)

Requires knowledge of relation schema (rel)