103#define REC_PER_KEY_UNKNOWN -1.0f
111#define IN_MEMORY_ESTIMATE_UNKNOWN -1.0
360 uint *key_length, uint *keypart);
372 const uchar *key2, uint key2_length);
LEX_CSTRING ref_db
Definition: key.h:50
uint key_parts
Definition: key.h:47
const char * name
Definition: key.h:45
LEX_CSTRING * fk_key_part
Definition: key.h:49
fk_option update_opt
Definition: key.h:53
const char * unique_index_name
Definition: key.h:46
fk_match_opt match_opt
Definition: key.h:54
LEX_CSTRING ref_table
Definition: key.h:51
fk_option delete_opt
Definition: key.h:52
LEX_CSTRING * key_part
Definition: key.h:48
void init_flags()
Fill data from given field.
Definition: table.cc:685
uint8 type
Definition: key.h:73
uint offset
Definition: key.h:60
void init_from_field(Field *fld)
Initialize KEY_PART_INFO from the given field.
Definition: table.cc:701
uint null_offset
Definition: key.h:61
uint16 fieldnr
Definition: key.h:71
uint16 length
Definition: key.h:63
uint16 store_length
Definition: key.h:70
Field * field
Definition: key.h:59
uint16 key_part_flag
Definition: key.h:72
uint8 null_bit
Definition: key.h:74
bool bin_cmp
True - if key part allows trivial binary comparison, False - if charset collation function needs to b...
Definition: key.h:87
ulong flags
dupp key and pack flags
Definition: key.h:118
ulong actual_flags
dupp key and pack flags for actual key parts
Definition: key.h:120
double in_memory_estimate() const
Retrieve the estimate for how much of the index data that is available in a memory buffer.
Definition: key.h:336
LEX_CSTRING comment
Definition: key.h:204
bool is_functional_index() const
Definition: key.cc:50
bool is_algorithm_explicit
A flag which indicates that index algorithm for this key was explicitly specified by user.
Definition: key.h:141
double m_in_memory_estimate
Estimate for how much of the index data that is currently available in a memory buffer.
Definition: key.h:182
KEY_PART_INFO * key_part
Definition: key.h:151
const char * name
Name of key.
Definition: key.h:153
rec_per_key_t records_per_key(uint key_part_no) const
Retrieve an estimate for the average number of records per distinct value, when looking only at the f...
Definition: key.h:236
bool is_visible
True if this index is visible to the query optimizer.
Definition: key.h:201
void set_records_per_key(uint key_part_no, rec_per_key_t rec_per_key_est)
Set the records per key estimate for a key part.
Definition: key.h:262
void move_rec_per_key(ulong *rec_per_key_arg, rec_per_key_t *rec_per_key_float_arg)
Move rec_per_key arrays from old to new position.
Definition: key.h:312
void set_in_memory_estimate(double in_memory_estimate)
Set the estimate for how much of this index that is currently in a memory buffer.
Definition: key.h:351
uint user_defined_key_parts
How many key_parts.
Definition: key.h:122
LEX_CSTRING engine_attribute
Definition: key.h:171
uint block_size
Definition: key.h:132
uint usable_key_parts
Should normally be = actual_key_parts.
Definition: key.h:131
rec_per_key_t * rec_per_key_float
Array of AVG(number of records with the same field value) for 1st ... Nth key part.
Definition: key.h:194
LEX_CSTRING secondary_engine_attribute
Definition: key.h:172
void set_rec_per_key_array(ulong *rec_per_key_arg, rec_per_key_t *rec_per_key_float_arg)
Assign storage for the rec per key arrays to the KEY object.
Definition: key.h:297
uint actual_key_parts
How many key_parts including hidden parts.
Definition: key.h:124
uint key_length
Tot length of key.
Definition: key.h:116
TABLE * table
Definition: key.h:203
plugin_ref parser
Note that parser is used when the table is opened for use, and parser_name is used when the table is ...
Definition: key.h:147
bool supports_records_per_key() const
Check if this key supports storing records per key information.
Definition: key.h:277
uint unused_key_parts
Key parts allocated for primary key parts extension but not used due to some reasons(no primary key,...
Definition: key.h:129
ulong * rec_per_key
Array of AVG(number of records with the same field value) for 1st ... Nth key part.
Definition: key.h:160
bool has_records_per_key(uint key_part_no) const
Check if records per key estimate is available for given key part.
Definition: key.h:214
LEX_CSTRING parser_name
Fulltext [pre]parser name.
Definition: key.h:149
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
static uint16 key1[1001]
Definition: hp_test2.cc:50
int key_rec_cmp(KEY **key_info, uchar *a, uchar *b)
Compare two records in index order.
Definition: key.cc:589
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
Compare key in record buffer to a given key.
Definition: key.cc:454
#define REC_PER_KEY_UNKNOWN
If an entry for a key part in KEY::rec_per_key_float[] has this value, then the storage engine has no...
Definition: key.h:103
void key_restore(uchar *to_record, const uchar *from_key, const KEY *key_info, uint key_length)
Restore a key from some buffer to record.
Definition: key.cc:179
void field_unpack(String *to, Field *field, uint max_length, bool prefix_key)
Unpack a field and append it.
Definition: key.cc:315
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
Definition: key.cc:411
#define IN_MEMORY_ESTIMATE_UNKNOWN
If the "in memory estimate" for a table (in ha_statistics.table_in_mem_estimate) or index (in KEY::m_...
Definition: key.h:111
void key_copy(uchar *to_key, const uchar *from_record, const KEY *key_info, uint key_length)
Copy part of a record that forms a key or key prefix to a buffer.
Definition: key.cc:135
int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field, uint *key_length, uint *keypart)
Definition: key.cc:86
int key_cmp2(KEY_PART_INFO *key_part, const uchar *key1, uint key1_length, const uchar *key2, uint key2_length)
Compare two given keys.
Definition: key.cc:505
void key_unpack(String *to, TABLE *table, KEY *key)
Definition: key.cc:372
float rec_per_key_t
Data type for records per key estimates that are stored in the KEY::rec_per_key_float[] array.
Definition: key.h:96
bool key_cmp_if_same(const TABLE *table, const uchar *key, uint index, uint key_length)
Compare if a key has changed.
Definition: key.cc:267
fk_match_opt
Definition: key_spec.h:58
fk_option
Definition: key_spec.h:49
This file includes constants used by all storage engines.
ha_key_alg
Definition: my_base.h:98
@ HA_KEY_ALG_SE_SPECIFIC
Used for cases when key algorithm which is supported by SE can't be described by one of other classes...
Definition: my_base.h:107
Some integer typedefs for easier portability.
uint8_t uint8
Definition: my_inttypes.h:63
unsigned char uchar
Definition: my_inttypes.h:52
uint16_t uint16
Definition: my_inttypes.h:65
static int record
Definition: mysqltest.cc:193
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Definition: mysql_lex_string.h:40
Definition: my_bitmap.h:43
Definition: sql_plugin_ref.h:45