KI_PREFETCH_ROWS

Set number of rows to prefetch on sequential reads

Synopsis:
CALL KI_PREFETCH_ROWS handle, rows TO [status], [oldvalue]
'ki_prefetch_rows( handle, rows, [status], [oldvalue] )
ArgumentEnumerationPurpose
handleHandle
rowsNumber of rows to prefetch
statusKDB_ERROR_ENUMReturn status
oldvaluePrevious value
>KI_PREFETCH_ROWS

KI_PREFETCH_ROWS

This allows a program to specify the number of rows to prefetch on a sequential access. It is only implemented for Oracle where it can, if used sensibly, avoid excessive round trips between KCML and the database server. On other databases it has no effect. The bufferring of the prefetched rows is handled transparently by KCML and an application just issues KI_READ_NEXT or KI_FETCH calls for each row separately. Setting a large value may use excessive memory inside KCML and may fetch rows from the database server that are never used. Furthermore it may not actually improve performance as the advantage drops off rapidly.

It should be set before any KI_START or KI_PREPARE.

This function can optionally return the previous value which can be useful if it needs to be restored.

By default KCML will prefetch a small number of rows. On a KI_READ_RAW the prefetch is set automatically to the buffer size overriding any value set by this function.

History
Introduced in KCML 6.60
See Also:
KI_BIND_COL, KI_BIND_PARAM, KI_BOUND_COL, KI_BOUND_PARAM, KI_CLOSE, KI_CLOSE_TABLE, KI_COLUMNS, KI_DATABASES, KI_DB_NAME, KI_DEFAULT_ROW, KI_DESCRIBE_COL, KI_DROP_TABLE, KI_ERROR, KI_ERROR_TEXT, KI_EXECUTE, KI_EXTEND, KI_FETCH, KI_GET_COL_LIST, KI_GET_ERROR_TEXT, KI_GET_HANDLE, KI_GET_SERIAL, KI_INFO, KI_INITIALISE, KI_LOCK_ALL, KI_OPEN, KI_PARTITIONS, KI_PREPARE, KI_REBUILD, KI_RESET_CACHEID, KI_SESSIONS, KI_SET_COL_LIST, KI_SET_DATESTAMP, KI_SET_SERIAL, KI_SET_TIMESTAMP, KI_SET_USERSTAMP, KI_SQL, KI_SQL_XML, KI_TABLES, KI_TABLESPACES, KI_UNLOCK_FILE, KI_VERIFY
KCML database status codes