Consultor Eletrônico



Kbase P92924: Why is the RECORD-LENGTH different to the max record size in TABANALYS ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/13/2004
Status: Unverified

GOAL:

Why is the RECORD-LENGTH different to the max record size in TABANALYS ?

GOAL:

How is the record size calculated in a tabanalys report ?

GOAL:

Why does tabanalys show different record size statistics after a dump and load ?

FIX:

There are at least 3 factors that make a difference between a record length reported by tabanalys and by the RECORD-LENGTH function:

1. For short records (more exactly for the records that are not fragmented across database blocks) - the record length reported in tabanalys is RECORD-LENGTH() + 2. Two extra bytes we can interpret as the bytes that store that record (or fragment) length in the record itself.

2. All records that are fragmented store additional information:
- the size of each fragment (2 bytes) as described above and
- RECID of the next fragment (4 bytes, except in the last fragment).

3. Schema versioning.
Firstly, the field map itself is not in the record. The field map is in _File and the record contains version control information in a "control field" preceding user data fields, so the current version of the record does not contribute directly to the scope of this discussion in terms of the record size reported by either tabanalys or RECORD-LENGTH.
Secondly, when a client gets a record in memory, it is always with up-to-date schema version. The data stored on disk however, may still have old structure. Tabanalys reports the length of data stored on disk. RECORD-LENGTH() function - length of data in memory. So storage length minus fragment overheads is still under 32000-byte limit for 4GL clients. This is why at times, after dumping a table, the MAX MIN MEAN statistical record values reported by TABANALYS differ ? because the record is dumped with the latest schema version and this may mean the removal of certain data contained in fields in earlier versions or the addition of new fields.

In other words, It is possible in Progress to have a record larger than 32k ON DISK. Progress storage architecture itself does not limit a record size. When we delete a field in a record, for example, the new schema version of that "previous version" is presented to the client in memory without that deleted field. The data that was contained in that field is still physically on disk, but marked as space for re-use by that record. Additionally, SQL clients can for example create large records. It's 4GL clients that can parse only those records that fit into ditem (data item) structure which is limited by 32000 bytes. So, taking the above two examples into account, in rare circumstances, a tabanalys report can show a "maximum record size" greater than 32KB but not when querying that RECID through 4GL and not after a dump and load of that table.