Understanding the Linear Hash SIZELOCK parameter and Best Practice Usage

The sizelock parameter is used to control the automatic resizing of the primary address space. A sizelock of "0" indicates that a table should be allowed to expand as more rows are entered, and become smaller as rows are deleted. A sizelock of "1" indicates that a table should be allowed to expand, but should not become smaller. This is useful in cases of a presized table, when a preliminary expectation is for the table to hold 1000 rows, but more rows may be added. If a sizelock is set to "2" or more, the table is not allowed to expand or contract. A sizelock of "2" is very important during a select operation executed on a network, when one user is searching a table for information while another user is entering new data.

OpenInsight increments the sizelock by 2 for the duration of the select operation. If another user is adding information, it is possible that the system could determine that a table needs to be resized. If this were to occur during a select operation, the process might yield unpredictable results: rows that have not yet been evaluated might be skipped, or rows might be processed more than once. Because the sizelock is "2", no resizing takes place. Once the process is finished, the sizelock is decremented by 2, restoring it to the table's original sizelock value. While the table might now be slightly out of size, the addition or deletion of another row will result in correct resizing.

The RTI_SET_SIZELOCK tool will allow an OpenInsight system administrator to globally set the sizlelock parameter on all or select tables.  For instance if a sizelock parameter is set to "2" or greater the table will not resize.  You can use this to disable resizing during busy periods and then re-enable resizing during quiet periods.

You can use this tool on any table, including ! and DICT files, as well as system files such as SYSLISTS and SYSOBJ.