You can provide configuration keywords that the access method interrogates to tailor its behavior. The user specifies one or more parameter choices in the USING clause of the CREATE INDEX statement. The access method calls the mi_tab_amparam() accessor function to retrieve the configuration keywords and values.
In the following example, the access method checks the keyword value to determine if the user wants mode set to the number of index entries to store in a shared memory buffer. The CREATE INDEX statement specifies the configuration keyword and value between parentheses.
CREATE INDEX ... IN sbspace USING sbspace_access_method ("setbuffer=10")
In the preceding statement, the mi_tab_amparam() function returns setbuffer=10. Figure 7 shows how the access method determines the value that the user specifies and applies it to create the sbspace.
mi_integer my_beginscan (sd) MI_AM_SCAN_DESC *sd; { MI_AM_TABLE_DESC *td; mi_ineger nrows; ... td=mi_scan_table(sd); /*Get table descriptor. */ /*Check for parameter. ** Do what the user specifies. If (mi_tab_amparam(td) != NULL) { /* Extract number of rows from string. ** Set nrows to that number. (not shown.) */ mi_tab_setniorows(nrows); } ... }
A user can specify multiple configuration parameters separated by commas, as the following syntax shows:
CREATE INDEX ... USING access_method_name (keyword='string', keyword='string' ...)Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]