The key descriptor contains information about an index key. If the index contains more than one key column, the access method might provide for following operator-class considerations:
Each key column corresponds to an operator class.
The key descriptor contains operator-class information on a per-column basis.
If the access method needs every column in the key, use the return value from mi_key_nkeys() as the number of times to execute mi_key_opclass_nsupt(). For example, the am_create purpose function, which builds the index, might need support functions for every column.
Use the return value from mi_key_opclass_nsupt() as the number of times to execute mi_key_opclass_supt().
The sample syntax retrieves all the support functions.
MI_KEY_DESC * keyDesc; mi_integer keyNum; mi_integer sfunctNum; mi_string sfunctName; keynum = mi_key_nkeys(keyDesc); for (k=0; k<= keyNum; k++) { sfunctNum = mi_key_opclass_nsupt(keyDesc, keyNum); for (i=0; i<=sfunctNum; i++) { sfunctName = mi_key_opclass_supt(keyDesc, keyNum, sfunctNum); /* ** Use the function name ** or store it in user data. (Not shown.) */ } /* End get sfunctName */ } /* End get sfunctNum */ } /* End get keynum */
The access method might need information about all the strategy functions for a particular key. For example, the access method might use the key descriptor rather than the qualification descriptor to identify strategy functions.
If the access method needs every column in the key, use the return value from mi_key_nkeys() as the number of times to execute mi_key_opclass_nstrat().
Use the return value from mi_key_opclass_nstrat() as the number of times to execute mi_key_opclass_strat().
To retrieve all the strategy functions, substitute mi_key_opclass_nstrat() for mi_key_opclass_nsupt() and mi_key_opclass_strat() for mi_key_opclass_supt() in Figure 10.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]