Write or choose strategy and support functions
In a query, the WHERE clause might specify a strategy function
to qualify or filter rows. The following clauses represent the same
strategy function, which compares the index key cost to a constant:
WHERE equal(cost, 100)
WHERE cost = 100
Support functions build and scan the index and can perform any
of the following tasks for a secondary access method:
- Build an index
- Search for specific key values
- Add and delete index entries
- Reorganize the index to accommodate new entries
The access method can call the same support function to perform
multiple tasks. For example, an access method might call a between() support
function to retrieve keys for the WHERE clause to test and locate
the entries immediately greater than and less than a new index entry
for an INSERT command.
Tip: If possible, use the built-in
B-tree operators or the operator class that a registered DataBlade module
provides. Write new functions only if necessary to fit the data types
that the secondary access method indexes.