gtpd1m2iDatabase Reference

Collection Residency

TPFCS classifies collections by a characteristic known as residency, which determines what the layout of the data is in the internal objects that comprise a collection. The two types of residency are compact and extended. For compact-resident collections, the data elements are embedded in the structure object itself. For extended-resident collections, the structure object only contains control information about the collection structure and the data elements are embedded in data records, which are chained to the structure object.

Note:
Because the data elements are embedded in compact structures, it is more effective to implement collections with fewer elements using compact structures. Likewise, it is more effective to implement collections with a very large number of elements using extended structures because of the overhead that is necessary to sort and retrieve those elements.

Every collection can be represented by a compact or extended structure. When a collection is first created it is compact-resident. TPFCS changes the internal representation of the collection to be extended-resident only when the collection has exceeded a predetermined size as more and more elements are added to it. Once TPFCS has made a collection extended-resident, the collection will remain that way even if the number of elements in the collection is significantly reduced.

Note:
Collections are not transformed back and forth from extended-resident to compact-resident to avoid overhead. There would be a performance impact for this transformation as a collection continued to increase and decrease in size as many elements were added to it and many were deleted from it.