MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dict_table_t Struct Reference

#include <dict0mem.h>

Collaboration diagram for dict_table_t:

Public Attributes

table_id_t id
mem_heap_theap
char * name
const char * dir_path_of_temp_table
char * data_dir_path
unsigned space:32
unsigned flags:DICT_TF_BITS
unsigned flags2:DICT_TF2_BITS
unsigned ibd_file_missing:1
unsigned cached:1
unsigned to_be_dropped:1
unsigned n_def:10
unsigned n_cols:10
unsigned can_be_evicted:1
unsigned corrupted:1
unsigned drop_aborted:1
dict_col_tcols
const char * col_names
hash_node_t name_hash
hash_node_t id_hash
 indexes
 foreign_list
 referenced_list
 table_LRU
unsigned fk_max_recusive_level:8
ulint n_foreign_key_checks_running
trx_id_t def_trx_id
trx_id_t query_cache_inv_trx_id
unsigned big_rows:1
ib_quiesce_t quiesce
ulint n_rec_locks
ulint n_ref_count
 locks
unsigned stat_initialized:1
ib_time_t stats_last_recalc
ib_uint32_t stat_persistent
ib_uint32_t stats_auto_recalc
ulint stats_sample_pages
ib_uint64_t stat_n_rows
ulint stat_clustered_index_size
ulint stat_sum_of_other_index_sizes
ib_uint64_t stat_modified_counter
byte stats_bg_flag
lock_tautoinc_lock
ib_mutex_t autoinc_mutex
ib_uint64_t autoinc
ulong n_waiting_or_granted_auto_inc_locks
const trx_tautoinc_trx
fts_tfts

Detailed Description

Data structure for a database table.  Most fields will be

initialized to 0, NULL or FALSE in dict_mem_table_create().

Definition at line 721 of file dict0mem.h.

Member Data Documentation

ib_uint64_t dict_table_t::autoinc

autoinc counter value to give to the next inserted row

Definition at line 949 of file dict0mem.h.

lock_t* dict_table_t::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 lock_sys_t::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 939 of file dict0mem.h.

ib_mutex_t dict_table_t::autoinc_mutex

mutex protecting the autoincrement counter

Definition at line 947 of file dict0mem.h.

const trx_t* dict_table_t::autoinc_trx

The transaction that currently holds the the AUTOINC lock on this table. Protected by lock_sys->mutex.

Definition at line 961 of file dict0mem.h.

unsigned dict_table_t::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 827 of file dict0mem.h.

unsigned dict_table_t::cached

TRUE if the table object has been added to the dictionary cache

Definition at line 743 of file dict0mem.h.

unsigned dict_table_t::can_be_evicted

TRUE if it's not an InnoDB system table or a table that has no FK relationships

Definition at line 756 of file dict0mem.h.

const char* dict_table_t::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 766 of file dict0mem.h.

dict_col_t* dict_table_t::cols

array of column descriptions

Definition at line 764 of file dict0mem.h.

unsigned dict_table_t::corrupted

TRUE if table is corrupted

Definition at line 759 of file dict0mem.h.

char* dict_table_t::data_dir_path

NULL or the directory path specified by DATA DIRECTORY

Definition at line 731 of file dict0mem.h.

trx_id_t dict_table_t::def_trx_id

transaction id that last touched the table definition, either when loading the definition or CREATE TABLE, or ALTER TABLE (prepare, commit, and rollback phases)

Definition at line 798 of file dict0mem.h.

const char* dict_table_t::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 725 of file dict0mem.h.

unsigned dict_table_t::drop_aborted

TRUE if some indexes should be dropped after ONLINE_INDEX_ABORTED or ONLINE_INDEX_ABORTED_DROPPED

Definition at line 761 of file dict0mem.h.

unsigned dict_table_t::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 786 of file dict0mem.h.

unsigned dict_table_t::flags

DICT_TF_...

Definition at line 736 of file dict0mem.h.

unsigned dict_table_t::flags2

DICT_TF2_...

Definition at line 737 of file dict0mem.h.

dict_table_t::foreign_list

list of foreign key constraints in the table; these refer to columns in other tables

Definition at line 777 of file dict0mem.h.

mem_heap_t* dict_table_t::heap

memory heap

Definition at line 723 of file dict0mem.h.

unsigned dict_table_t::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 739 of file dict0mem.h.

table_id_t dict_table_t::id

id of the table

Definition at line 722 of file dict0mem.h.

hash_node_t dict_table_t::id_hash

hash chain node

Definition at line 773 of file dict0mem.h.

dict_table_t::indexes

list of indexes of the table

Definition at line 775 of file dict0mem.h.

dict_table_t::locks

list of locks on the table; protected by lock_sys->mutex

Definition at line 987 of file dict0mem.h.

unsigned dict_table_t::n_cols

number of columns

Definition at line 754 of file dict0mem.h.

unsigned dict_table_t::n_def

number of columns defined so far

Definition at line 753 of file dict0mem.h.

ulint dict_table_t::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 792 of file dict0mem.h.

ulint dict_table_t::n_rec_locks

Count of the number of record locks on this table. We use this to determine whether we can evict the table from the dictionary cache. It is protected by lock_sys->mutex.

Definition at line 976 of file dict0mem.h.

ulint dict_table_t::n_ref_count

count of how many handles are 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 981 of file dict0mem.h.

ulong dict_table_t::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 lock_sys_t::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 952 of file dict0mem.h.

char* dict_table_t::name

table name

Definition at line 724 of file dict0mem.h.

hash_node_t dict_table_t::name_hash

hash chain node

Definition at line 772 of file dict0mem.h.

trx_id_t dict_table_t::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 804 of file dict0mem.h.

ib_quiesce_t dict_table_t::quiesce

Quiescing states, protected by the dict_index_t::lock. ie. we can only change the state if we acquire all the latches (dict_index_t::lock) in X mode of this table's indexes.

Definition at line 968 of file dict0mem.h.

dict_table_t::referenced_list

list of foreign key constraints which refer to this table

Definition at line 781 of file dict0mem.h.

unsigned dict_table_t::space

space where the clustered index of the table is placed

Definition at line 734 of file dict0mem.h.

ulint dict_table_t::stat_clustered_index_size

approximate clustered index size in database pages

Definition at line 887 of file dict0mem.h.

unsigned dict_table_t::stat_initialized

Statistics for query optimization TRUE if statistics have been calculated the first time after database startup or table creation

Definition at line 832 of file dict0mem.h.

ib_uint64_t dict_table_t::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 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 892 of file dict0mem.h.

ib_uint64_t dict_table_t::stat_n_rows

approximate number of rows in the table; we periodically calculate new estimates

Definition at line 884 of file dict0mem.h.

ib_uint32_t dict_table_t::stat_persistent

The two bits below are set in the ::stat_persistent member and have the following meaning:

  1. _ON=0, _OFF=0, no explicit persistent stats setting for this table, the value of the global srv_stats_persistent is used to determine whether the table has persistent stats enabled or not
  2. _ON=0, _OFF=1, persistent stats are explicitly disabled for this table, regardless of the value of the global srv_stats_persistent
  3. _ON=1, _OFF=0, persistent stats are explicitly enabled for this table, regardless of the value of the global srv_stats_persistent
  4. _ON=1, _OFF=1, not allowed, we assert if this ever happens.

Definition at line 838 of file dict0mem.h.

ulint dict_table_t::stat_sum_of_other_index_sizes

other indexes in database pages

Definition at line 890 of file dict0mem.h.

ib_uint32_t dict_table_t::stats_auto_recalc

The two bits below are set in the ::stats_auto_recalc member and have the following meaning:

  1. _ON=0, _OFF=0, no explicit auto recalc setting for this table, the value of the global srv_stats_persistent_auto_recalc is used to determine whether the table has auto recalc enabled or not
  2. _ON=0, _OFF=1, auto recalc is explicitly disabled for this table, regardless of the value of the global srv_stats_persistent_auto_recalc
  3. _ON=1, _OFF=0, auto recalc is explicitly enabled for this table, regardless of the value of the global srv_stats_persistent_auto_recalc
  4. _ON=1, _OFF=1, not allowed, we assert if this ever happens.

Definition at line 857 of file dict0mem.h.

byte dict_table_t::stats_bg_flag

see BG_STAT_* above. Writes are covered by dict_sys->mutex. Dirty reads are possible.

Definition at line 918 of file dict0mem.h.

ib_time_t dict_table_t::stats_last_recalc

Timestamp of last recalc of the stats

Definition at line 836 of file dict0mem.h.

ulint dict_table_t::stats_sample_pages

the number of pages to sample for this table during persistent stats estimation; if this is 0, then the value of the global srv_stats_persistent_sample_pages will be used instead.

Definition at line 878 of file dict0mem.h.

dict_table_t::table_LRU

node of the LRU list of tables

Definition at line 784 of file dict0mem.h.

unsigned dict_table_t::to_be_dropped

TRUE if the table is to be dropped, but not yet actually dropped (could in the bk drop list); It is turned on at the beginning of row_drop_table_for_mysql() and turned off just before we start to update system tables for the drop. It is protected by dict_operation_lock

Definition at line 746 of file dict0mem.h.


The documentation for this struct was generated from the following file: