102#define REC_PER_KEY_UNKNOWN -1.0f
110#define IN_MEMORY_ESTIMATE_UNKNOWN -1.0
359 uint *key_length, uint *keypart);
371 const uchar *key2, uint key2_length);
LEX_CSTRING ref_db
Definition: key.h:49
uint key_parts
Definition: key.h:46
const char * name
Definition: key.h:44
LEX_CSTRING * fk_key_part
Definition: key.h:48
fk_option update_opt
Definition: key.h:52
const char * unique_index_name
Definition: key.h:45
fk_match_opt match_opt
Definition: key.h:53
LEX_CSTRING ref_table
Definition: key.h:50
fk_option delete_opt
Definition: key.h:51
LEX_CSTRING * key_part
Definition: key.h:47
void init_flags()
Fill data from given field.
Definition: table.cc:682
uint8 type
Definition: key.h:72
uint offset
Definition: key.h:59
void init_from_field(Field *fld)
Initialize KEY_PART_INFO from the given field.
Definition: table.cc:698
uint null_offset
Definition: key.h:60
uint16 fieldnr
Definition: key.h:70
uint16 length
Definition: key.h:62
uint16 store_length
Definition: key.h:69
Field * field
Definition: key.h:58
uint16 key_part_flag
Definition: key.h:71
uint8 null_bit
Definition: key.h:73
bool bin_cmp
True - if key part allows trivial binary comparison, False - if charset collation function needs to b...
Definition: key.h:86
ulong flags
dupp key and pack flags
Definition: key.h:117
ulong actual_flags
dupp key and pack flags for actual key parts
Definition: key.h:119
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:335
LEX_CSTRING comment
Definition: key.h:203
bool is_functional_index() const
Definition: key.cc:49
bool is_algorithm_explicit
A flag which indicates that index algorithm for this key was explicitly specified by user.
Definition: key.h:140
double m_in_memory_estimate
Estimate for how much of the index data that is currently available in a memory buffer.
Definition: key.h:181
KEY_PART_INFO * key_part
Definition: key.h:150
const char * name
Name of key.
Definition: key.h:152
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:235
bool is_visible
True if this index is visible to the query optimizer.
Definition: key.h:200
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:261
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:311
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:350
uint user_defined_key_parts
How many key_parts.
Definition: key.h:121
LEX_CSTRING engine_attribute
Definition: key.h:170
uint block_size
Definition: key.h:131
uint usable_key_parts
Should normally be = actual_key_parts.
Definition: key.h:130
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:193
LEX_CSTRING secondary_engine_attribute
Definition: key.h:171
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:296
uint actual_key_parts
How many key_parts including hidden parts.
Definition: key.h:123
uint key_length
Tot length of key.
Definition: key.h:115
TABLE * table
Definition: key.h:202
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:146
bool supports_records_per_key() const
Check if this key supports storing records per key information.
Definition: key.h:276
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:128
ulong * rec_per_key
Array of AVG(number of records with the same field value) for 1st ... Nth key part.
Definition: key.h:159
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:213
LEX_CSTRING parser_name
Fulltext [pre]parser name.
Definition: key.h:148
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
static uint16 key1[1001]
Definition: hp_test2.cc:49
int key_rec_cmp(KEY **key_info, uchar *a, uchar *b)
Compare two records in index order.
Definition: key.cc:588
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:453
#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:102
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:178
void field_unpack(String *to, Field *field, uint max_length, bool prefix_key)
Unpack a field and append it.
Definition: key.cc:314
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields)
Definition: key.cc:410
#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:110
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:134
int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field, uint *key_length, uint *keypart)
Definition: key.cc:85
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:504
void key_unpack(String *to, TABLE *table, KEY *key)
Definition: key.cc:371
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:95
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:266
fk_match_opt
Definition: key_spec.h:57
fk_option
Definition: key_spec.h:48
This file includes constants used by all storage engines.
ha_key_alg
Definition: my_base.h:96
@ 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:105
Some integer typedefs for easier portability.
uint8_t uint8
Definition: my_inttypes.h:62
unsigned char uchar
Definition: my_inttypes.h:51
uint16_t uint16
Definition: my_inttypes.h:64
static int record
Definition: mysqltest.cc:194
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Definition: mysql_lex_string.h:39
Definition: my_bitmap.h:42
Definition: sql_plugin_ref.h:44