c-tree’s index range support permits ISAM record reads in a manner similar to sets, but with more control. An index range is defined by specifying a range of values for one or more key segments. Each record retrieved must satisfy all the specified ranges.
The following segment range types are supported:
Mode |
Explanation |
---|---|
CTIX_EQ |
Equality (key == target) |
CTIX_GT |
Strictly greater than (key > target) |
CTIX_GE |
Greater than or equal (key >= target) |
CTIX_LE |
Less than or equal (key <= target) |
CTIX_LT |
Strictly less than (key < target) |
CTIX_NE |
Not equal (key != target) |
CTIX_BET |
Between inclusive (targetLow <= key) && (key <= targetHigh) |
CTIX_BET_IE |
Between inclusive lower range (targetLow <= key) && (key < targetHigh) |
CTIX_BET_EI |
Between inclusive upper range (targetLow < key) && (key <= targetHigh) |
CTIX_BET_EE |
Between exclusive (targetLow < key) && (key < targetHigh) |
CTIX_NOTBET |
Not between (key < targetLow) || (key > targetHigh) |
You do not need to specify a range for all segments, but you cannot skip a segment. For instance, you could specify a range for the first segment or the first and second segment, etc. If you wanted to specify ranges for the first and third segment, you would need to specify ranges for the first three segments, and you would make the second segment all inclusive (for example, using a segment range such as CTIX_GE with a zero lower limit).
Each user can have only one range definition for each index. Specifying a new range for an index automatically frees an existing range definition for that index.