MySQL 9.1.0
Source Code Documentation
Opt_hints_table Class Reference

Table level hints. More...

#include <opt_hints.h>

Inheritance diagram for Opt_hints_table:
[legend]

Public Member Functions

 Opt_hints_table (const LEX_CSTRING *table_name_arg, Opt_hints_qb *qb_hints_arg, MEM_ROOT *mem_root_arg)
 
void append_name (const THD *thd, String *str) override
 Append table name. More...
 
void adjust_key_hints (Table_ref *table)
 Function sets correlation between key hint objects and appropriate KEY structures. More...
 
PT_hintget_complex_hints (opt_hints_enum type) override
 Returns pointer to complex hint for a given type. More...
 
void set_resolved () override
 
void set_unresolved (opt_hints_enum type_arg) override
 Set hint to unresolved state. More...
 
bool is_resolved (opt_hints_enum type_arg) override
 Returns 'resolved' flag value for depending on hint type. More...
 
void set_compound_key_hint_map (Opt_hints *hint, uint arg)
 
Compound_key_hintget_compound_key_hint (opt_hints_enum type_arg)
 
bool is_force_index_hint (opt_hints_enum type_arg)
 
bool is_hint_conflicting (Opt_hints_key *key_hint, opt_hints_enum type)
 
void update_index_hint_map (Key_map *keys_to_use, Key_map *available_keys_to_use, opt_hints_enum type_arg)
 Function updates key_to_use key map depending on index hint state. More...
 
bool update_index_hint_maps (THD *thd, TABLE *tbl)
 Function updates keys_in_use_for_query, keys_in_use_for_group_by, keys_in_use_for_order_by depending on INDEX, JOIN_INDEX, GROUP_INDEX, ORDER_INDEX hints. More...
 
- Public Member Functions inherited from Opt_hints
 Opt_hints (const LEX_CSTRING *name_arg, Opt_hints *parent_arg, MEM_ROOT *mem_root_arg)
 
virtual ~Opt_hints ()=default
 
bool is_specified (opt_hints_enum type_arg) const
 
bool set_switch (bool switch_state_arg, opt_hints_enum type_arg, bool check_parent)
 Function sets switch hint state. More...
 
bool get_switch (opt_hints_enum type_arg) const
 Function returns switch hint state. More...
 
virtual const LEX_CSTRINGget_name () const
 
virtual const LEX_CSTRINGget_print_name ()
 
void set_name (const LEX_CSTRING *name_arg)
 
Opt_hintsget_parent () const
 
virtual bool ignore_print (opt_hints_enum type_arg) const
 If ignore_print() returns true, hint is not printed in Opt_hints::print() function. More...
 
void incr_resolved_children ()
 
Mem_root_array< Opt_hints * > * child_array_ptr ()
 
bool is_all_resolved () const
 
void register_child (Opt_hints *hint_arg)
 
Opt_hintsfind_by_name (const LEX_CSTRING *name_arg, const CHARSET_INFO *cs) const
 Find hint among lower-level hint objects. More...
 
void print (const THD *thd, String *str, enum_query_type query_type)
 Print all hints except of QB_NAME hint. More...
 
void check_unresolved (THD *thd)
 Check if there are any unresolved hint objects and print warnings for them. More...
 

Public Attributes

Mem_root_array< Opt_hints_key * > keyinfo_array
 
Compound_key_hint index_merge
 
Compound_key_hint skip_scan
 
Glob_index_key_hint index
 
Index_key_hint join_index
 
Index_key_hint group_index
 
Index_key_hint order_index
 

Detailed Description

Table level hints.

Constructor & Destructor Documentation

◆ Opt_hints_table()

Opt_hints_table::Opt_hints_table ( const LEX_CSTRING table_name_arg,
Opt_hints_qb qb_hints_arg,
MEM_ROOT mem_root_arg 
)
inline

Member Function Documentation

◆ adjust_key_hints()

void Opt_hints_table::adjust_key_hints ( Table_ref table)

Function sets correlation between key hint objects and appropriate KEY structures.

Parameters
tablePointer to Table_ref object

◆ append_name()

void Opt_hints_table::append_name ( const THD thd,
String str 
)
inlineoverridevirtual

Append table name.

Parameters
thdpointer to THD object
strpointer to String object

Implements Opt_hints.

◆ get_complex_hints()

PT_hint * Opt_hints_table::get_complex_hints ( opt_hints_enum  type)
overridevirtual

Returns pointer to complex hint for a given type.

A complex hint is a hint that has arguments. (It is not just an on/off switch.)

Parameters
typehint type
Returns
pointer to complex hint for a given type.

Reimplemented from Opt_hints.

◆ get_compound_key_hint()

Compound_key_hint * Opt_hints_table::get_compound_key_hint ( opt_hints_enum  type_arg)
inline

◆ is_force_index_hint()

bool Opt_hints_table::is_force_index_hint ( opt_hints_enum  type_arg)
inline

◆ is_hint_conflicting()

bool Opt_hints_table::is_hint_conflicting ( Opt_hints_key key_hint,
opt_hints_enum  type 
)

◆ is_resolved()

bool Opt_hints_table::is_resolved ( opt_hints_enum  type_arg)
inlineoverridevirtual

Returns 'resolved' flag value for depending on hint type.

Parameters
type_arghint type
Returns
true if all hint objects are resolved, false otherwise.

Reimplemented from Opt_hints.

◆ set_compound_key_hint_map()

void Opt_hints_table::set_compound_key_hint_map ( Opt_hints hint,
uint  arg 
)
inline

◆ set_resolved()

void Opt_hints_table::set_resolved ( )
inlineoverridevirtual

Reimplemented from Opt_hints.

◆ set_unresolved()

void Opt_hints_table::set_unresolved ( opt_hints_enum  type_arg)
inlineoverridevirtual

Set hint to unresolved state.

Parameters
type_arghint type

Reimplemented from Opt_hints.

◆ update_index_hint_map()

void Opt_hints_table::update_index_hint_map ( Key_map keys_to_use,
Key_map available_keys_to_use,
opt_hints_enum  type_arg 
)

Function updates key_to_use key map depending on index hint state.

Parameters
keys_to_usekey to use
available_keys_to_useavailable keys to use
type_arghint type

◆ update_index_hint_maps()

bool Opt_hints_table::update_index_hint_maps ( THD thd,
TABLE tbl 
)

Function updates keys_in_use_for_query, keys_in_use_for_group_by, keys_in_use_for_order_by depending on INDEX, JOIN_INDEX, GROUP_INDEX, ORDER_INDEX hints.

Parameters
thdpointer to THD object
tblpointer to TABLE object
Returns
false if no index hint is specified, true otherwise.

Member Data Documentation

◆ group_index

Index_key_hint Opt_hints_table::group_index

◆ index

Glob_index_key_hint Opt_hints_table::index

◆ index_merge

Compound_key_hint Opt_hints_table::index_merge

◆ join_index

Index_key_hint Opt_hints_table::join_index

◆ keyinfo_array

Mem_root_array<Opt_hints_key *> Opt_hints_table::keyinfo_array

◆ order_index

Index_key_hint Opt_hints_table::order_index

◆ skip_scan

Compound_key_hint Opt_hints_table::skip_scan

The documentation for this class was generated from the following files: