Go Back

Free records on ISAM files

Does anybody know if anything else, apart from a delete, adds to the free count on an ISAM file. When you run ipar it's next to the record count. When our batch invoice program runs the free count increases but there is no direct delete on the file in question just a few fields get amended. Would old indexes also appear in free? Our customer is using Synergy 8.3.1 (revision 4 files) and some web programs written using Synergy.Net (10.3.3) using XfServer (10.3.3) to point to the 8.3.1 ISAM files on the Unix server. The program in question is running on the Unix Server. 

1 Answer
0   | Posted by Rachel Blunden to Synergy DBMS on 3/4/2019 11:19 AM
Jerry Fawcett
When an ISAM record allows either variable length and/or data compression, the physical data segments stored to the data file (.is1) are variable length.

Whenever use of one of these data segments is released, it is added to the data free list and the "free" count is incremented.

The most obvious way for this to happen is via DELETE, which causes a segment or segments associated with a record to be freed.

Another way, which only occurs with variable length segments, is when updating a record (via WRITE) and the new record contents grows and no longer fits in its original data segment.  This is very common with data compression.  When this happens, the new record contents are physically written to a new location in the data file, and the original data segment is released.  This freed data segment is added to the free list and counted as "free".

Also, a Revision 6 ISAM file (or pre-Revision 6 with static RFA) this behavior is slightly different.  When a record update occurs that exceeds the size of the original data segment, it keeps track of the original data segment (to maintain the static RFA position) and creates a vector link between the original and the new data segments.  Then, after this initial vectoring of a record, any update that requires a new larger data segment generates a new vector and releases the last vectored data segment.  This freed data segment is added to the free list and counted as "free".

Running "isutl –vb" can be used to show more data free list details.

The ipar utility reports the number of records and on the same line shows number of "free" (in this case, data segments).  There is no way to distinguish only deleted records, unless the file is created fixed length with no compression.  In that case, as the data segments will never change, "free" would represent the actual number of records deleted.

If this counter increases this is not an indication that records are incorrectly deleted.

3/7/2019 6:45 PM   1  
Please log in to comment or answer this question.