The mi_tab_setniorows() accessor function

The mi_tab_setniorows() function indicates that the access method can handle more than one row per call and the number of rows for which the database server should allocate memory.

Syntax

mi_integer mi_tab_setniorows(MI_AM_TABLE_DESC *tableDesc,
   mi_integer nrows)
tableDesc
Points to the index descriptor.
nrows
Specifies the maximum number of rows that am_getnext or am_insert processes.

Usage

The access method must call this function in either am_open or am_beginscan. Multiple calls to mi_tab_setniorows() during the execution of a single statement causes an exception to be raised.

A secondary access method can set up a multiple-row area in shared memory for use in one or both of the following purpose functions:
  • The database server can place multiple entries in shared memory that the am_insert purpose function retrieves and writes to disk.
  • The am_getnext purpose function can fetch multiple rows into shared memory in response to a query.

Return values

The integer indicates the actual number of rows for which the database server allocates memory. Currently, the return value equals nrows. A zero or negative return value indicates an error.