Function returns search mode that needs to be used to read the next record.
It takes the type of the range, the key part's order (ascending or descending) and if the range is on MIN function or a MAX function to get the right search mode. For "MIN" function:
- ASC keypart We need to
- Read the first key that matches the range a) if a minimum value is not specified in the condition b) if it is a equality or is NULL condition
- Read the first key after a range value if range is like "a > 10"
- Read the key that matches the condition or any key after the range value for any other condition
- DESC keypart We need to
- Read the last value for the key prefix if there is no minimum range specified.
- Read the first key that matches the range if it is a equality condition.
- Read the first key before a range value if range is like "a > 10"
- Read the key that matches the prefix or any key before for any other condition For MAX function:
- ASC keypart We need to
- Read the last value for the key prefix if there is no maximum range specified
- Read the first key that matches the range if it is a equality condition
- Read the first key before a range value if range is like "a < 10"
- Read the key that matches the condition or any key before the range value for any other condition
- Read the first key that matches the range a) if a minimum value is not specified in the condition b) if it is a equality
- Read the first key after a range value if range is like "a < 10"
- Read the key that matches the prefix or any key after for any other condition
- Parameters
-
cur_range | pointer to QUICK_RANGE. |
is_asc | TRUE if key part is ascending, FALSE otherwise. |
is_min | TRUE if the range is on MIN function. FALSE for MAX function. |
- Returns
- search mode