13.9

In the variable-length record representation, a null bitmap is used to indicate if an attribute has the null value.

  1. For variable-length fields, if the value is null, what would be stored in the offset and length fields?

  2. In some applications, tuples have a very large number of attributes, most of which are null. Can you modify the record representation such that the only overhead for a null attribute is the single bit in the null bitmap?


  1. For variable-length fields, if the value is null, what would be stored in the offset and length fields?

We should store -1 in the length field. Any number in the offset field is fine, since a length of -1 will indiciate that the field is null.

  1. In some applications, tuples have a very large number of attributes, most of which are null. Can you modify the record representation such that the only overhead for a null attribute is the single bit in the null bitmap?

Yes. By storing the null bitmap at the beginning of the record, we are not obliged to store data (value, or offset/length). Such a representation would save some storage space, at the cost of extra work to extract attributes of the record. This representation is particularly useful for certain applications where records have a large number of fields, most of which are null.