#include <dict0mem.h>
Public Attributes | |
table_id_t | id |
mem_heap_t * | heap |
char * | name |
const char * | dir_path_of_temp_table |
unsigned | space:32 |
unsigned | flags:DICT_TF2_BITS |
unsigned | ibd_file_missing:1 |
unsigned | tablespace_discarded:1 |
unsigned | cached:1 |
unsigned | n_def:10 |
unsigned | n_cols:10 |
dict_col_t * | cols |
const char * | col_names |
hash_node_t | name_hash |
hash_node_t | id_hash |
indexes | |
foreign_list | |
referenced_list | |
table_LRU | |
ulint | n_mysql_handles_opened |
unsigned | fk_max_recusive_level:8 |
ulint | n_foreign_key_checks_running |
trx_id_t | query_cache_inv_trx_id |
locks | |
unsigned | big_rows:1 |
unsigned | stat_initialized:1 |
ib_int64_t | stat_n_rows |
ulint | stat_clustered_index_size |
ulint | stat_sum_of_other_index_sizes |
ulint | stat_modified_counter |
lock_t * | autoinc_lock |
mutex_t | autoinc_mutex |
ib_uint64_t | autoinc |
ulong | n_waiting_or_granted_auto_inc_locks |
const trx_t * | autoinc_trx |
Data structure for a database table. Most fields will be
initialized to 0, NULL or FALSE in dict_mem_table_create().
Definition at line 437 of file dict0mem.h.
ib_uint64_t dict_table_struct::autoinc |
autoinc counter value to give to the
next inserted row
Definition at line 587 of file dict0mem.h.
Referenced by dict_mem_table_create(), dict_table_autoinc_initialize(), dict_table_autoinc_read(), and dict_table_autoinc_update_if_greater().
lock_t* dict_table_struct::autoinc_lock |
!< The following fields are used by the AUTOINC code. The actual collection of tables locked during AUTOINC read/write is kept in trx_t. In order to quickly determine whether a transaction has locked the AUTOINC lock we keep a pointer to the transaction here in the autoinc_trx variable. This is to avoid acquiring the kernel mutex and scanning the vector in trx_t.
When an AUTOINC lock has to wait, the corresponding lock instance is created on the trx lock heap rather than use the pre-allocated instance in autoinc_lock below. a buffer for an AUTOINC lock for this table: we allocate the memory here so that individual transactions can get it and release it without a need to allocate space from the lock heap of the trx: otherwise the lock heap would grow rapidly if we do a large insert from a select
Definition at line 576 of file dict0mem.h.
Referenced by dict_mem_table_create().
mutex_t dict_table_struct::autoinc_mutex |
mutex protecting the autoincrement
counter
Definition at line 584 of file dict0mem.h.
Referenced by dict_mem_table_create(), dict_mem_table_free(), dict_table_autoinc_initialize(), dict_table_autoinc_lock(), dict_table_autoinc_read(), dict_table_autoinc_unlock(), and dict_table_autoinc_update_if_greater().
const trx_t* dict_table_struct::autoinc_trx |
The transaction that currently holds the
the AUTOINC lock on this table.
Definition at line 598 of file dict0mem.h.
Referenced by row_lock_table_autoinc_for_mysql().
unsigned dict_table_struct::big_rows |
flag: TRUE if the maximum length of
a single row exceeds BIG_ROW_SIZE; initialized in dict_table_add_to_cache()
Definition at line 529 of file dict0mem.h.
Referenced by dict_table_add_to_cache().
unsigned dict_table_struct::cached |
TRUE if the table object has been added
to the dictionary cache
Definition at line 461 of file dict0mem.h.
Referenced by dict_mem_table_free(), dict_table_add_system_columns(), dict_table_add_to_cache(), and dict_table_rename_in_cache().
const char* dict_table_struct::col_names |
Column names packed in a character string
"name1\0name2\0...nameN\0". Until the string contains n_cols, it will be allocated from a temporary heap. The final string will be allocated from table->heap.
Definition at line 466 of file dict0mem.h.
Referenced by dict_mem_table_add_col(), and dict_table_get_col_name().
dict_col_t* dict_table_struct::cols |
array of column descriptions
Definition at line 465 of file dict0mem.h.
Referenced by build_template(), calc_row_difference(), dict_mem_table_create(), and mlog_parse_index().
const char* dict_table_struct::dir_path_of_temp_table |
NULL or the directory path
where a TEMPORARY table that was explicitly created by a user should be placed if innodb_file_per_table is defined in my.cnf; in Unix this is usually /tmp/..., in Windows temp...
Definition at line 441 of file dict0mem.h.
Referenced by create_table_def(), dict_table_rename_in_cache(), row_drop_table_for_mysql(), and row_truncate_table_for_mysql().
unsigned dict_table_struct::fk_max_recusive_level |
maximum recursive level we support when
loading tables chained together with FK constraints. If exceeds this level, we will stop loading child table into memory along with its parent table
Definition at line 492 of file dict0mem.h.
Referenced by dict_load_table().
unsigned dict_table_struct::flags |
DICT_TF_COMPACT, ...
Definition at line 450 of file dict0mem.h.
Referenced by ha_innobase::delete_all_rows(), dict_load_table(), dict_mem_table_create(), dict_table_print_low(), ha_innobase::discard_or_import_tablespace(), ha_innobase::doDeleteRecord(), ha_innobase::doInsertRecord(), ha_innobase::doUpdateRecord(), ha_innobase::general_fetch(), ha_innobase::index_read(), ha_innobase::reset_auto_increment(), row_drop_table_for_mysql(), row_import_tablespace_for_mysql(), and row_merge_create_temporary_table().
dict_table_struct::foreign_list |
list of foreign key constraints
in the table; these refer to columns in other tables
Definition at line 478 of file dict0mem.h.
Referenced by ha_innobase::can_switch_engines(), dict_create_add_foreigns_to_dictionary(), dict_foreign_add_to_cache(), dict_table_get_foreign_constraint(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_table_replace_index_in_foreign_list(), ha_innobase::get_foreign_key_list(), and row_ins_index_entry().
mem_heap_t* dict_table_struct::heap |
memory heap
Definition at line 439 of file dict0mem.h.
Referenced by create_table_def(), dict_mem_table_add_col(), dict_mem_table_create(), dict_mem_table_free(), dict_table_add_to_cache(), dict_table_remove_from_cache(), mlog_parse_index(), and pars_create_table().
unsigned dict_table_struct::ibd_file_missing |
TRUE if this is in a single-table
tablespace and the .ibd file is missing; then we must return in ha_innodb.cc an error if the user tries to query such an orphaned table
Definition at line 451 of file dict0mem.h.
Referenced by ha_innobase::check(), dict_load_table(), dict_update_statistics(), ha_innobase::doOpen(), row_discard_tablespace_for_mysql(), row_import_tablespace_for_mysql(), row_ins_check_foreign_constraint(), row_insert_for_mysql(), row_rename_table_for_mysql(), row_search_for_mysql(), row_truncate_table_for_mysql(), and row_update_for_mysql().
table_id_t dict_table_struct::id |
id of the table
Definition at line 438 of file dict0mem.h.
Referenced by dict_boot(), dict_load_column_low(), dict_table_add_to_cache(), dict_table_change_id_in_cache(), dict_table_print_low(), dict_table_remove_from_cache(), lock_get_table_id(), row_drop_table_for_mysql(), row_merge_rename_indexes(), row_truncate_table_for_mysql(), and trx_undo_prev_version_build().
hash_node_t dict_table_struct::id_hash |
hash chain node
Definition at line 474 of file dict0mem.h.
dict_table_struct::indexes |
list of indexes of the table
Definition at line 476 of file dict0mem.h.
Referenced by dict_check_tablespaces_and_store_max_id(), dict_create_or_check_foreign_constraint_tables(), dict_get_first_table_name_in_db(), dict_index_add_to_cache(), dict_index_remove_from_cache(), dict_load_table(), dict_startscan_system(), dict_table_print_low(), dict_table_remove_from_cache(), dict_truncate_index_tree(), ha_innobase::info(), and innobase_build_index_translation().
dict_table_struct::locks |
list of locks on the table
Definition at line 513 of file dict0mem.h.
Referenced by lock_get_src_table(), lock_is_table_exclusive(), lock_remove_all_on_table(), and row_search_check_if_query_cache_permitted().
unsigned dict_table_struct::n_cols |
number of columns
Definition at line 464 of file dict0mem.h.
Referenced by dict_mem_table_add_col(), dict_mem_table_create(), dict_table_add_system_columns(), and dict_table_print_low().
unsigned dict_table_struct::n_def |
number of columns defined so far
Definition at line 463 of file dict0mem.h.
Referenced by dict_load_column_low(), dict_mem_table_add_col(), dict_table_add_system_columns(), and dict_table_add_to_cache().
ulint dict_table_struct::n_foreign_key_checks_running |
count of how many foreign key check
operations are currently being performed on the table: we cannot drop the table while there are foreign key checks running on it!
Definition at line 498 of file dict0mem.h.
Referenced by row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), and row_truncate_table_for_mysql().
ulint dict_table_struct::n_mysql_handles_opened |
count of how many handles MySQL has opened
to this table; dropping of the table is NOT allowed until this count gets to zero; MySQL does NOT itself check the number of open handles at drop
Definition at line 486 of file dict0mem.h.
Referenced by dict_table_decrement_handle_count(), dict_table_get(), row_drop_database_for_mysql(), row_drop_table_for_mysql(), and row_merge_drop_table().
ulong dict_table_struct::n_waiting_or_granted_auto_inc_locks |
This counter is used to track the number
of granted and pending autoinc locks on this table. This value is set after acquiring the kernel mutex but we peek the contents to determine whether other transactions have acquired the AUTOINC lock or not. Of course only one transaction can be granted the lock but there can be multiple waiters.
Definition at line 589 of file dict0mem.h.
Referenced by dict_mem_table_create().
char* dict_table_struct::name |
table name
Definition at line 440 of file dict0mem.h.
Referenced by ha_innobase::check(), create_table_def(), dict_index_add_to_cache(), dict_index_remove_from_cache(), dict_load_table(), dict_mem_table_create(), dict_mem_table_free(), dict_table_add_to_cache(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_truncate_index_tree(), dict_update_statistics(), ha_innobase::discard_or_import_tablespace(), ha_innobase::info(), ha_innobase::innobase_get_index(), ha_innobase::innobase_initialize_autoinc(), ha_innobase::innobase_peek_autoinc(), lock_get_table_name(), lock_table_print(), row_create_table_for_mysql(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_import_tablespace_for_mysql(), row_insert_for_mysql(), row_merge_create_index(), row_merge_drop_table(), row_merge_rename_tables(), row_prebuilt_free(), row_search_for_mysql(), row_truncate_table_for_mysql(), row_update_for_mysql(), and row_update_prebuilt_trx().
hash_node_t dict_table_struct::name_hash |
hash chain node
Definition at line 473 of file dict0mem.h.
trx_id_t dict_table_struct::query_cache_inv_trx_id |
transactions whose trx id is
smaller than this number are not allowed to store to the MySQL query cache or retrieve from it; when a trx with undo logs commits, it sets this to the value of the trx id counter for the tables it had an IX lock on
Definition at line 504 of file dict0mem.h.
Referenced by lock_release_off_kernel(), and row_search_check_if_query_cache_permitted().
dict_table_struct::referenced_list |
list of foreign key constraints
which refer to this table
Definition at line 482 of file dict0mem.h.
Referenced by ha_innobase::can_switch_engines(), dict_foreign_add_to_cache(), dict_table_get_referenced_constraint(), dict_table_is_referenced_by_foreign_key(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), and row_truncate_table_for_mysql().
unsigned dict_table_struct::space |
space where the clustered index of the
table is placed
Definition at line 447 of file dict0mem.h.
Referenced by dict_load_table(), dict_mem_table_create(), dict_table_rename_in_cache(), ha_innobase::info(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_import_tablespace_for_mysql(), row_truncate_table_for_mysql(), and ha_innobase::update_table_comment().
ulint dict_table_struct::stat_clustered_index_size |
approximate clustered index size in
database pages
Definition at line 541 of file dict0mem.h.
Referenced by dict_update_statistics(), ha_innobase::info(), and ha_innobase::scan_time().
unsigned dict_table_struct::stat_initialized |
Statistics for query optimization TRUE if statistics have been calculated the first time after database startup or table creation
Definition at line 535 of file dict0mem.h.
Referenced by dict_update_statistics().
ulint dict_table_struct::stat_modified_counter |
when a row is inserted, updated,
or deleted, we add 1 to this number; we calculate new estimates for the stat_... values for the table and the indexes at an interval of 2 GB or when about 1 / 16 of table has been modified; also when the estimate operation is called for MySQL SHOW TABLE STATUS; the counter is reset to zero at statistics calculation; this counter is not protected by any latch, because this is only used for heuristics
Definition at line 546 of file dict0mem.h.
Referenced by dict_update_statistics().
ib_int64_t dict_table_struct::stat_n_rows |
approximate number of rows in the table;
we periodically calculate new estimates
Definition at line 538 of file dict0mem.h.
Referenced by btr_estimate_n_rows_in_range(), dict_table_print_low(), dict_update_statistics(), ha_innobase::info(), row_insert_for_mysql(), row_update_cascade_for_mysql(), and row_update_for_mysql().
ulint dict_table_struct::stat_sum_of_other_index_sizes |
other indexes in database pages
Definition at line 544 of file dict0mem.h.
Referenced by dict_update_statistics(), and ha_innobase::info().
dict_table_struct::table_LRU |
node of the LRU list of tables
Definition at line 485 of file dict0mem.h.
unsigned dict_table_struct::tablespace_discarded |
this flag is set TRUE when the user
calls DISCARD TABLESPACE on this table, and reset to FALSE in IMPORT TABLESPACE
Definition at line 456 of file dict0mem.h.
Referenced by row_discard_tablespace_for_mysql(), and row_import_tablespace_for_mysql().