Skip to content
  • Sergey Glukhov's avatar
    71f13d38
    Bug#19806106 PARTIAL INDEX NEVER HAS \"USING INDEX\" EVEN IF IT IS COVERING. · 71f13d38
    Sergey Glukhov authored
    The fix currently implemented for the LIKE function only.
    Later it can be extended for other functions.
    
    Added new field to the FIELD class:
    
    Key_map part_of_prefixkey;
    
    Added new method to the FIELD class:
    
    /**
      Get covering prefix keys.
    
      @retval covering prefix keys.
    */
    Key_map get_covering_prefix_keys();
    
    Added new field to the Item_field class:
    
    /*
       TRUE if it's possible to set prefix key as covering
       depending on internal logic of the function.
    */
    bool can_use_prefix_key;
    
    Added new methods to the Item_field class:
    
    /*
       The method sets 'can_use_prefix_key' to TRUE before
       calling ::fix_fields() for the arguments. This method
       is called only for the argument which can be used for
       prefix key reading. If 'can_use_prefix_key' is TRUE
       we don't remove prefix keys from the covering keys.
       It allows to make decision if the key is covering later
       in appropriate function(currently LIKE function only).
    */
    void set_can_use_prefix_key()
    
    Changes in Item_func_like class:
    
    In Item_func_like::fix_fields first argument is set as 'can_use_prefix_key'
    before arguments fixing. After function arguments are fixed new method
    Item_func_like::check_covering_prefix_keys() is called. It sets covering keys
    depending on constant part of the wild patttern.
    
    Added new method:
    Item_func_like::check_covering_prefix_keys();
    
    Changes in table.cc:
    
    In TABLE::mark_column_used, intersect TABLE::covering_keys with the union
    of part_of_key and part_of_prefixkey.
    
    Added new method:
    /**
      Update covering keys depending on max read key length.
    
      @param[in]   field             Pointer to field object
      @param[in]   key_read_length   Max read key length
    */
    void TABLE::update_covering_prefix_keys(Field *field, uint16 key_read_length);
    71f13d38
    Bug#19806106 PARTIAL INDEX NEVER HAS \"USING INDEX\" EVEN IF IT IS COVERING.
    Sergey Glukhov authored
    The fix currently implemented for the LIKE function only.
    Later it can be extended for other functions.
    
    Added new field to the FIELD class:
    
    Key_map part_of_prefixkey;
    
    Added new method to the FIELD class:
    
    /**
      Get covering prefix keys.
    
      @retval covering prefix keys.
    */
    Key_map get_covering_prefix_keys();
    
    Added new field to the Item_field class:
    
    /*
       TRUE if it's possible to set prefix key as covering
       depending on internal logic of the function.
    */
    bool can_use_prefix_key;
    
    Added new methods to the Item_field class:
    
    /*
       The method sets 'can_use_prefix_key' to TRUE before
       calling ::fix_fields() for the arguments. This method
       is called only for the argument which can be used for
       prefix key reading. If 'can_use_prefix_key' is TRUE
       we don't remove prefix keys from the covering keys.
       It allows to make decision if the key is covering later
       in appropriate function(currently LIKE function only).
    */
    void set_can_use_prefix_key()
    
    Changes in Item_func_like class:
    
    In Item_func_like::fix_fields first argument is set as 'can_use_prefix_key'
    before arguments fixing. After function arguments are fixed new method
    Item_func_like::check_covering_prefix_keys() is called. It sets covering keys
    depending on constant part of the wild patttern.
    
    Added new method:
    Item_func_like::check_covering_prefix_keys();
    
    Changes in table.cc:
    
    In TABLE::mark_column_used, intersect TABLE::covering_keys with the union
    of part_of_key and part_of_prefixkey.
    
    Added new method:
    /**
      Update covering keys depending on max read key length.
    
      @param[in]   field             Pointer to field object
      @param[in]   key_read_length   Max read key length
    */
    void TABLE::update_covering_prefix_keys(Field *field, uint16 key_read_length);
Loading