![]() |
MySQL
8.0.12
Source Code Documentation
|
Data structure for an index. More...
#include <dict0mem.h>
Public Member Functions | |
bool | is_committed () const |
Determine if the index has been committed to the data dictionary. More... | |
void | set_committed (bool committed) |
Flag an index committed or uncommitted. More... | |
const dict_index_t * | next () const |
Get the next index. More... | |
dict_index_t * | next () |
Get the next index. More... | |
bool | is_corrupted () const |
Check whether the index is corrupted. More... | |
bool | is_clustered () const |
ulint | get_min_size () const |
Returns the minimum data size of an index record. More... | |
bool | is_usable (const trx_t *trx) const |
Check whether index can be used by transaction. More... | |
bool | has_instant_cols () const |
Check whether index has any instantly added columns. More... | |
uint32_t | get_n_nullable_before (uint32_t nth) const |
Returns the number of nullable fields before specified nth field. More... | |
uint32_t | get_instant_fields () const |
Returns the number of fields before first instant ADD COLUMN. More... | |
void | add_field (const char *name_arg, ulint prefix_len, bool is_ascending) |
Adds a field definition to an index. More... | |
dict_field_t * | get_field (ulint pos) const |
Gets the nth field of an index. More... | |
const dict_col_t * | get_col (ulint pos) const |
Gets pointer to the nth column in an index. More... | |
ulint | get_col_no (ulint pos) const |
Gets the column number the nth field in an index. More... | |
ulint | get_sys_col_pos (ulint type) const |
Returns the position of a system column in an index. More... | |
ulint | get_col_pos (ulint n, bool inc_prefix=false, bool is_virtual=false) const |
Looks for column n in an index. More... | |
const byte * | get_nth_default (uint16_t nth, ulint *length) const |
Get the default value of nth field and its length if exists. More... | |
void | fill_srid_value (uint32_t srid_value, bool srid_is_valid_value) |
Sets srid and srid_is_valid values. More... | |
Public Attributes | |
space_index_t | id |
id of the index More... | |
mem_heap_t * | heap |
memory heap More... | |
id_name_t | name |
index name More... | |
const char * | table_name |
table name More... | |
dict_table_t * | table |
back pointer to table More... | |
unsigned | space: 32 |
space where the index tree is placed More... | |
unsigned | page: 32 |
index tree root page number More... | |
unsigned | merge_threshold: 6 |
In the pessimistic delete, if the page data size drops below this limit in percent, merging it to a neighbor is tried. More... | |
unsigned | type: DICT_IT_BITS |
index type (DICT_CLUSTERED, DICT_UNIQUE, DICT_IBUF, DICT_CORRUPT) More... | |
unsigned | trx_id_offset: MAX_KEY_LENGTH_BITS |
position of the trx id column in a clustered index record, if the fields before it are known to be of a fixed size, 0 otherwise More... | |
unsigned | n_user_defined_cols: 10 |
number of columns the user defined to be in the index: in the internal representation we add more columns More... | |
unsigned | allow_duplicates: 1 |
if true, allow duplicate values even if index is created with unique constraint More... | |
unsigned | nulls_equal: 1 |
if true, SQL NULL == SQL NULL More... | |
unsigned | disable_ahi: 1 |
if true, then disable AHI. More... | |
unsigned | n_uniq: 10 |
number of fields from the beginning which are enough to determine an index entry uniquely More... | |
unsigned | n_def: 10 |
number of fields defined so far More... | |
unsigned | n_fields: 10 |
number of fields in the index More... | |
unsigned | n_nullable: 10 |
number of nullable fields More... | |
unsigned | n_instant_nullable: 10 |
number of nullable fields before first instant ADD COLUMN applied to this table. More... | |
unsigned | cached: 1 |
TRUE if the index object is in the dictionary cache. More... | |
unsigned | to_be_dropped: 1 |
TRUE if the index is to be dropped; protected by dict_operation_lock. More... | |
unsigned | online_status: 2 |
enum online_index_status. More... | |
unsigned | uncommitted: 1 |
a flag that is set for secondary indexes that have not been committed to the data dictionary yet More... | |
unsigned | instant_cols: 1 |
TRUE if the index is clustered index and it has some instant columns. More... | |
uint32_t | srid |
bool | srid_is_valid |
std::unique_ptr< dd::Spatial_reference_system > | rtr_srs |
Cached spatial reference system dictionary entry used by R-tree indexes. More... | |
uint32_t | magic_n |
magic number More... | |
dict_field_t * | fields |
array of field descriptions More... | |
st_mysql_ftparser * | parser |
fulltext parser plugin More... | |
bool | is_ngram |
true if it's ngram parser More... | |
bool | has_new_v_col |
whether it has a newly added virtual column in ALTER More... | |
bool | hidden |
if the index is an hidden index More... | |
indexes | |
list of indexes of the table More... | |
btr_search_t * | search_info |
info used in optimistic searches More... | |
row_log_t * | online_log |
the log of modifications during online index creation; valid when online_status is ONLINE_INDEX_CREATION More... | |
last_ops_cur_t * | last_ins_cur |
cache the last insert position. More... | |
last_ops_cur_t * | last_sel_cur |
cache the last selected position Currently limited to intrinsic table only. More... | |
rec_cache_t | rec_cache |
cache the field that needs to be re-computed on each insert. More... | |
rtr_ssn_t | rtr_ssn |
Node sequence number for RTree. More... | |
rtr_info_track_t * | rtr_track |
tracking all R-Tree search cursors More... | |
trx_id_t | trx_id |
id of the transaction that created this index, or 0 if the index existed when InnoDB was started up More... | |
zip_pad_info_t | zip_pad |
Information about state of compression failures and successes. More... | |
rw_lock_t | lock |
read-write lock protecting the upper levels of the index tree More... | |
bool | fill_dd |
Flag whether need to fill dd tables when it's a fulltext index. More... | |
ib_uint64_t * | stat_n_diff_key_vals |
Statistics for query optimization. More... | |
ib_uint64_t * | stat_n_sample_sizes |
number of pages that were sampled to calculate each of stat_n_diff_key_vals[], e.g. More... | |
ib_uint64_t * | stat_n_non_null_key_vals |
ulint | stat_index_size |
approximate index size in database pages More... | |
ulint | stat_n_leaf_pages |
approximate number of leaf pages in the index tree More... | |
Data structure for an index.
Most fields will be initialized to 0, NULL or FALSE in dict_mem_index_create().
|
inline |
Adds a field definition to an index.
NOTE: does not take a copy of the column name if the field is a column. The memory occupied by the column name may be released only after publishing the index.
[in] | name_arg | column name |
[in] | prefix_len | 0 or the column prefix length in a MySQL index like INDEX (textcol(25)) |
[in] | is_ascending | true=ASC, false=DESC |
|
inline |
Sets srid and srid_is_valid values.
[in] | srid_value | value of SRID, may be garbage if srid_is_valid_value = false |
[in] | srid_is_valid_value | value of srid_is_valid |
|
inline |
Gets pointer to the nth column in an index.
[in] | pos | position of the field |
ulint dict_index_t::get_col_no | ( | ulint | pos | ) | const |
Gets the column number the nth field in an index.
[in] | pos | position of the field |
Looks for column n in an index.
[in] | n | column number |
[in] | inc_prefix | true=consider column prefixes too |
[in] | is_virtual | true==virtual column |
|
inline |
Gets the nth field of an index.
[in] | pos | position of field |
uint32_t dict_index_t::get_instant_fields | ( | ) | const |
Returns the number of fields before first instant ADD COLUMN.
|
inline |
Returns the minimum data size of an index record.
|
inline |
Returns the number of nullable fields before specified nth field.
[in] | nth | nth field to check |
|
inline |
Get the default value of nth field and its length if exists.
If not exists, both the return value is nullptr and length is 0.
[in] | nth | nth field to get |
[in,out] | length | length of the default value |
ulint dict_index_t::get_sys_col_pos | ( | ulint | type | ) | const |
Returns the position of a system column in an index.
[in] | type | DATA_ROW_ID, ... |
|
inline |
Check whether index has any instantly added columns.
|
inline |
|
inline |
Determine if the index has been committed to the data dictionary.
|
inline |
Check whether the index is corrupted.
Check whether index can be used by transaction.
[in] | trx | transaction |
|
inline |
Get the next index.
NULL | if this was the last index |
|
inline |
Get the next index.
NULL | if this was the last index |
|
inline |
Flag an index committed or uncommitted.
[in] | committed | whether the index is committed |
unsigned dict_index_t::allow_duplicates |
if true, allow duplicate values even if index is created with unique constraint
unsigned dict_index_t::cached |
TRUE if the index object is in the dictionary cache.
unsigned dict_index_t::disable_ahi |
if true, then disable AHI.
Currently limited to intrinsic temporary table and SDI table as index id is not unique for such table which is one of the validation criterion for ahi.
dict_field_t* dict_index_t::fields |
array of field descriptions
bool dict_index_t::fill_dd |
Flag whether need to fill dd tables when it's a fulltext index.
bool dict_index_t::has_new_v_col |
whether it has a newly added virtual column in ALTER
mem_heap_t* dict_index_t::heap |
memory heap
bool dict_index_t::hidden |
if the index is an hidden index
space_index_t dict_index_t::id |
id of the index
dict_index_t::indexes |
list of indexes of the table
unsigned dict_index_t::instant_cols |
TRUE if the index is clustered index and it has some instant columns.
bool dict_index_t::is_ngram |
true if it's ngram parser
last_ops_cur_t* dict_index_t::last_ins_cur |
cache the last insert position.
Currently limited to auto-generated clustered index on intrinsic table only.
last_ops_cur_t* dict_index_t::last_sel_cur |
cache the last selected position Currently limited to intrinsic table only.
rw_lock_t dict_index_t::lock |
read-write lock protecting the upper levels of the index tree
uint32_t dict_index_t::magic_n |
magic number
unsigned dict_index_t::merge_threshold |
In the pessimistic delete, if the page data size drops below this limit in percent, merging it to a neighbor is tried.
unsigned dict_index_t::n_def |
number of fields defined so far
unsigned dict_index_t::n_fields |
number of fields in the index
unsigned dict_index_t::n_instant_nullable |
number of nullable fields before first instant ADD COLUMN applied to this table.
This is valid only when has_instant_cols() is true
unsigned dict_index_t::n_nullable |
number of nullable fields
unsigned dict_index_t::n_uniq |
number of fields from the beginning which are enough to determine an index entry uniquely
unsigned dict_index_t::n_user_defined_cols |
number of columns the user defined to be in the index: in the internal representation we add more columns
id_name_t dict_index_t::name |
index name
unsigned dict_index_t::nulls_equal |
if true, SQL NULL == SQL NULL
row_log_t* dict_index_t::online_log |
the log of modifications during online index creation; valid when online_status is ONLINE_INDEX_CREATION
unsigned dict_index_t::online_status |
enum online_index_status.
Transitions from ONLINE_INDEX_COMPLETE (to ONLINE_INDEX_CREATION) are protected by dict_operation_lock and dict_sys->mutex. Other changes are protected by index->lock.
unsigned dict_index_t::page |
index tree root page number
st_mysql_ftparser* dict_index_t::parser |
fulltext parser plugin
rec_cache_t dict_index_t::rec_cache |
cache the field that needs to be re-computed on each insert.
Limited to intrinsic table as this is common share and can't be used without protection if table is accessible to multiple-threads.
std::unique_ptr<dd::Spatial_reference_system> dict_index_t::rtr_srs |
Cached spatial reference system dictionary entry used by R-tree indexes.
rtr_ssn_t dict_index_t::rtr_ssn |
Node sequence number for RTree.
rtr_info_track_t* dict_index_t::rtr_track |
tracking all R-Tree search cursors
btr_search_t* dict_index_t::search_info |
info used in optimistic searches
unsigned dict_index_t::space |
space where the index tree is placed
uint32_t dict_index_t::srid |
bool dict_index_t::srid_is_valid |
ulint dict_index_t::stat_index_size |
approximate index size in database pages
ib_uint64_t* dict_index_t::stat_n_diff_key_vals |
Statistics for query optimization.
approximate number of different key values for this index, for each n-column prefix where 1 <= n <= dict_get_n_unique(index) (the array is indexed from 0 to n_uniq-1); we periodically calculate new estimates
ulint dict_index_t::stat_n_leaf_pages |
approximate number of leaf pages in the index tree
ib_uint64_t* dict_index_t::stat_n_non_null_key_vals |
ib_uint64_t* dict_index_t::stat_n_sample_sizes |
number of pages that were sampled to calculate each of stat_n_diff_key_vals[], e.g.
stat_n_sample_sizes[3] pages were sampled to get the number stat_n_diff_key_vals[3].
dict_table_t* dict_index_t::table |
back pointer to table
const char* dict_index_t::table_name |
table name
unsigned dict_index_t::to_be_dropped |
TRUE if the index is to be dropped; protected by dict_operation_lock.
trx_id_t dict_index_t::trx_id |
id of the transaction that created this index, or 0 if the index existed when InnoDB was started up
unsigned dict_index_t::trx_id_offset |
position of the trx id column in a clustered index record, if the fields before it are known to be of a fixed size, 0 otherwise
unsigned dict_index_t::type |
index type (DICT_CLUSTERED, DICT_UNIQUE, DICT_IBUF, DICT_CORRUPT)
unsigned dict_index_t::uncommitted |
a flag that is set for secondary indexes that have not been committed to the data dictionary yet
zip_pad_info_t dict_index_t::zip_pad |
Information about state of compression failures and successes.