Automatic File Sizing, when to use

Automatic File Sizing – AFS can significant help with most files that grow and shrink over time. There are areas to consider, however, which this FAQ covers in summary.

Use of AFS should be reviewed…
… both for existing databases that may not have any auto-sized files and new databases that may have all files auto-sized.

Although all files can be enabled for AFS at file creation, or converted using AFS-ENABLE there are some that may not prove to be viable. These are typically temporary or "work files" that build up during each work period like end of month, quarter or year. These should be managed so that AFS does not constantly try to resize up and down as these files fill and are emptied. This management is always a trade-off covering disk space usage, efficient file access for serial and random access and saving data for backups.

During upgrades is a good time to check if AFS is already enabled and review viable usage. Some customers have enabled AFS but excluded certain files, however, others have enabled whole systems for AFS. Depending on the nature of the application and database file structures this may lead to performance issues during certain activities like end of period processing as mentioned above.

It is recommended that AFS should be used as the default on systems, providing potential issues have been reviewed. Restoring of databases should then use the (E option during the ACCOUNT-RESTORE; which will expand/resize the files during the restore for optimal layout.

Note that AFS attempts to resize files for efficient interactive access but disk fragmentation can still occur depending on application usage. AFS will typically significantly reduce the time taken to resizing files manually, however, systems always require occasional save and restore operations to maintain optimal efficient access and reduce any data fragmentation.
 

When reviewing use of Automatic File Sizing you need to be aware of the following points:

  1. AFS was introduced into Reality in version V11.0 for user data files, with key System files being AFS enabled from V15.1. 
  2. When auto-sizing was introduced the default was to have a new parameter in the Master config file, AutoFileSize=N. Only systems that have been loaded with Reality for the first time with version V14.0 or above will have AFS enabled for newly created databases, AutoFileSize=Y, i.e. when the Master config file was first delivered with this set to "Y".
  3. The default of using AFS is only ever enabled for new databases, for existing databases this needs to be enabled manually.
  4. If Reality was installed prior to version V14.0 then, as the Master config file is not updated by new versions or releases, the default will still be for (non)auto-sized created databases.
  5. The only way to tell if AFS is enabled for a database is to refer to the config file for each database (database_filepath/configs/config). Note the Master config file (REALROOT/files/config) is used to create each database config file when the database is created.
  6. If the Master config file has been unchanged since the default was AutoFileSize=N, or users have edited this to have "N" set (or this parameter was removed), then the default will be non-auto-sized.
  7. Regardless of AutoFileSize=N being set in the database config file, if files are created without specifying a modulo and separation using CREATE-FILE, or the TCL command AFS-SET is used, the file will be created to use auto-sizing.


How to tell if files are auto-sized:

In the following the LISTFILES command will list auto-sized files as Ftype of H2/H3 for auto-sized Dict/Data files and B2/B3 for non-auto-sized Dict/Data files.

File name   Type   Ftype
FILE-1         DL     H2  << AFS
 FILE-1        DL     H3
FILE-2         DL     B2  << Non-AFS
 FILE-2        DL     B3

Further information is provided for auto-sized files by the ISTAT command using the (U option.
For example, using the above file examples.

An ISTAT FILE-1 (U   << AFS
File='FILE-1'
Num-groups=7 Frame-size=1008 Hash-type=22 (AFS, *11)
AFS details: Dynamic-mod 7 Next-split 1 Reserved 0 Slots-free 120

An ISTAT FILE-2 (U  << Non-AFS
File='FILE-2'
Modulus=7 Frame-size=1008 Hash-type=2 (*11)
 

Refer to the ISTAT (U command in the Documentation for further information on file sizing.

Back to articles