Go to the source code of this file.
 | 
| namespace   | opt_range | 
|   | Shared sentinel node for all trees. 
  | 
|   | 
 | 
| void  | print_tree (String *out, const char *tree_name, SEL_TREE *tree, const RANGE_OPT_PARAM *param, const bool print_full) | 
|   | 
| void  | append_range (String *out, const KEY_PART_INFO *key_parts, const uchar *min_key, const uchar *max_key, const uint flag) | 
|   | Append range info for a key part to a string.  More...
  | 
|   | 
| void  | append_range_all_keyparts (Opt_trace_array *range_trace, String *range_string, String *range_so_far, SEL_ROOT *keypart, const KEY_PART_INFO *key_parts, const bool print_full) | 
|   | Traverse an R-B tree of range conditions and append all ranges for this keypart and consecutive keyparts to range_trace (if non-NULL) or to range_string (if range_trace is NULL).  More...
  | 
|   | 
| void  | append_range_to_string (const QUICK_RANGE *range, const KEY_PART_INFO *first_key_part, String *out) | 
|   | 
| int  | index_next_different (bool is_index_scan, handler *file, KEY_PART_INFO *key_part, uchar *record, const uchar *group_prefix, uint group_prefix_len, uint group_key_parts) | 
|   | Find the next different key value by skipping all the rows with the same key value.  More...
  | 
|   | 
| void  | print_key_value (String *out, const KEY_PART_INFO *key_part, const uchar *key) | 
|   | Print a key to a string.  More...
  | 
|   | 
◆ double2rows
      
        
          | #define double2rows | 
          ( | 
            | 
          x | ) | 
             ((ha_rows)(x)) | 
        
      
 
 
◆ append_range()
Append range info for a key part to a string. 
- Parameters
 - 
  
    | [in,out] | out | String the range info is appended to  | 
    | [in] | key_part | Indexed column used in a range select  | 
    | [in] | min_key | Key tuple describing lower bound of range  | 
    | [in] | max_key | Key tuple describing upper bound of range  | 
    | [in] | flag | Key range flags defining what min_key and max_key represent  | 
  
   
- See also
 - my_base.h 
 
 
 
◆ append_range_all_keyparts()
Traverse an R-B tree of range conditions and append all ranges for this keypart and consecutive keyparts to range_trace (if non-NULL) or to range_string (if range_trace is NULL). 
See description of R-B trees/SEL_ARG for details on how ranges are linked.
- Parameters
 - 
  
    | [in,out] | range_trace | Optimizer trace array ranges are appended to  | 
    | [in,out] | range_string | The string where range predicates are appended when the last keypart has been reached.  | 
     | range_so_far | String containing ranges for keyparts prior to this keypart.  | 
     | keypart | The R-B tree containing intervals for this keypart.  | 
     | key_parts | Index components description, used when adding information to the optimizer trace  | 
     | print_full | Whether or not ranges on unusable keyparts should be printed. Useful for debugging. | 
  
   
- Note
 - This function mimics the behavior of sel_arg_range_seq_next() 
 
 
 
◆ append_range_to_string()
◆ index_next_different()
      
        
          | int index_next_different  | 
          ( | 
          bool  | 
          is_index_scan,  | 
        
        
           | 
           | 
          handler *  | 
          file,  | 
        
        
           | 
           | 
          KEY_PART_INFO *  | 
          key_part,  | 
        
        
           | 
           | 
          uchar *  | 
          record,  | 
        
        
           | 
           | 
          const uchar *  | 
          group_prefix,  | 
        
        
           | 
           | 
          uint  | 
          group_prefix_len,  | 
        
        
           | 
           | 
          uint  | 
          group_key_parts  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Find the next different key value by skipping all the rows with the same key value. 
Implements a specialized loose index access method for queries containing aggregate functions with distinct of the form: SELECT SUM|COUNT|AVG FROM t This method comes to replace the index scan + Unique class (distinct selection) for loose index scan that visits all the rows of a covering index instead of jumping in the beginning of each group. TODO: Placeholder function. To be replaced by a handler API call
- Parameters
 - 
  
    | is_index_scan | hint to use index scan instead of random index read to find the next different value.  | 
    | file | table handler  | 
    | key_part | group key to compare  | 
    | record | row data  | 
    | group_prefix | current key prefix data  | 
    | group_prefix_len | length of the current key prefix data  | 
    | group_key_parts | number of the current key prefix columns  | 
  
   
- Returns
 - status 
 
- Return values
 - 
  
  
 
 
 
◆ print_key_value()
Print a key to a string. 
- Parameters
 - 
  
    | [out] | out | String the key is appended to  | 
    | [in] | key_part | Index components description  | 
    | [in] | key | Key tuple  | 
  
   
 
 
◆ print_tree()