KI_GROW

Increase table size

Synopsis:
CALL KI_GROW handle, nNewRows, eMode TO status
status = 'ki_grow( handle, nNewRows, eMode )
ArgumentEnumerationPurpose
handleHandle of file
nNewRowsNumber of rows after the operation
eModeKDB_GROW_ENUMMode of growth
statusKDB_ERROR_ENUMReturn status
>KI_GROW

KI_GROW

This function will resize a KDB table to a new, larger size adjusting the index appropriately. An exclusive lock may taken during this operation. This replaces the obsolete KI_EXTEND function. Modes supported are:

Mode Purpose
_KDB_GROW_TABLE Extend a table to accommodate the new number of rows. This will work on all types of KDB tables but it will be quite disk intensive on a KDB6 table where it may have to shuffle data and should only be done if the table does not have extents defined. An exclusive lock is taken.
_KDB_GROW_EXTENT Add an extent to a KDB6 table according to the specification established by KI_SET_EXTENT. Only W mode access is required. This is much faster than mode 1 for a KDB6 table but there is a limit on the maximum number of extents allowed.
_KDB_GROW_TRUNCATE This truncates the table to rows rows which must be greater than the data highwater mark. This only works with KDB6 tables that have been consolidated to one index and one data extent. It also performs a full index rebuild and will require an exclusive open.

For KDB7 tables mode _KDB_GROW_TABLE and mode _KDB_GROW_EXTENT are identical and cause sufficient extra pages to be added to the table to accommodate the extra rows and a guess for the size of the index they would require. This is quite efficient and, though the table will be locked while this happens, it should only take a short time.

SQL considerations

KI_GROW is not applicable to SQL databases and will have no effect.

History
Introduced in KCML 5.02
See Also:
KI_COPY_TABLE, KI_CREATE, KI_CREATE_TMP, KI_DELETE_ROWS, KI_GET_SERIAL, KI_INFO, KI_INITIALISE, KI_LOCK_ALL, KI_LOCK_OWNER, KI_MOVE_ROWS, KI_MOVE_TABLE, KI_OPEN, KI_READ, KI_READ_HOLD, KI_READ_HOLD_NEXT, KI_READ_HOLD_PTR, KI_READ_NEXT, KI_READ_PTR, KI_READ_RAW, KI_REBUILD, KI_REWRITE, KI_SET_EXTENT, KI_SET_ROWS, KI_SET_SERIAL, KI_SET_WLOCK_COUNT, KI_SIZE_FILE, KI_START, KI_START_BEG, KI_UNLOCK, KI_UNLOCK_FILE, KI_VERIFY, KI_WMODE_BITMAP, KI_WRITE, KI_WRITE_PTR, KI_WRITE_RAW, KI_WS_CREATE, KI_WS_DELETE, KI_WS_OPEN, KI_WS_READ, KI_WS_REWRITE, KI_WS_WRITE
KCML database status codes