The mi_key_opclass_nstrat() accessor function
The mi_key_opclass_nstrat() function retrieves the number of strategy functions in the operator class associated with the key.
Syntax
mi_integer mi_key_opclass_nstrat(MI_AM_KEY_DESC *keyDesc,
mi_integer keyNum)
- keyDesc
- Points to the key descriptor.
- keyNum
- Specifies the column number of a key in a composite-key index
or 0 for a single-key index.
For the first (or only) key, pass 0 as keyNum. Increment keyNum by 1 for each subsequent key in a composite index.
Usage
The access method can use either the function name or routine identifier to execute a strategy function. Use mi_key_opclass_nstrat() if the access method needs strategy-function names. The mi_key_opclass_nstrat() returns the number of function names to retrieve for a single key-column with the mi_key_opclass_strat() function.
For a multiple-column key, mi_key_opclass_nstrat() might return different values for each column. The integer argument keyNum specifies a column by sequential position in the index key. A one-column index contains only keyNum 0. A two-column composite key contains keyNum 0 and 1. To determine the maximum keyNum value, call mi_key_nkeys(). If mi_key_nkeys() returns a value of 1 or greater, the index contains multiple key columns.
Return values
A positive integer indicates the number of strategy functions that the key descriptor contains for the specified column in the key.
A value of -1 indicates that keyNum specifies an invalid column number for the key.