drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
dict_table_struct Struct Reference

#include <dict0mem.h>

Collaboration diagram for dict_table_struct:
[legend]

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
unsigned corrupted:1
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

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 468 of file dict0mem.h.

Member Data Documentation

◆ autoinc

ib_uint64_t dict_table_struct::autoinc

autoinc counter value to give to the next inserted row

Definition at line 620 of file dict0mem.h.

◆ autoinc_lock

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 609 of file dict0mem.h.

◆ autoinc_mutex

mutex_t dict_table_struct::autoinc_mutex

mutex protecting the autoincrement counter

Definition at line 617 of file dict0mem.h.

◆ autoinc_trx

const trx_t* dict_table_struct::autoinc_trx

The transaction that currently holds the the AUTOINC lock on this table.

Definition at line 631 of file dict0mem.h.

◆ big_rows

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 562 of file dict0mem.h.

◆ cached

unsigned dict_table_struct::cached

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

Definition at line 492 of file dict0mem.h.

◆ col_names

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 499 of file dict0mem.h.

◆ cols

dict_col_t* dict_table_struct::cols

array of column descriptions

Definition at line 498 of file dict0mem.h.

◆ corrupted

unsigned dict_table_struct::corrupted

TRUE if table is corrupted

Definition at line 496 of file dict0mem.h.

◆ dir_path_of_temp_table

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 472 of file dict0mem.h.

◆ fk_max_recusive_level

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 525 of file dict0mem.h.

◆ flags

unsigned dict_table_struct::flags

DICT_TF_COMPACT, ...

Definition at line 481 of file dict0mem.h.

◆ foreign_list

dict_table_struct::foreign_list

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

Definition at line 511 of file dict0mem.h.

◆ heap

mem_heap_t* dict_table_struct::heap

memory heap

Definition at line 470 of file dict0mem.h.

◆ ibd_file_missing

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 482 of file dict0mem.h.

◆ id

table_id_t dict_table_struct::id

id of the table

Definition at line 469 of file dict0mem.h.

◆ id_hash

hash_node_t dict_table_struct::id_hash

hash chain node

Definition at line 507 of file dict0mem.h.

◆ indexes

dict_table_struct::indexes

list of indexes of the table

Definition at line 509 of file dict0mem.h.

◆ locks

dict_table_struct::locks

list of locks on the table

Definition at line 546 of file dict0mem.h.

◆ n_cols

unsigned dict_table_struct::n_cols

number of columns

Definition at line 495 of file dict0mem.h.

◆ n_def

unsigned dict_table_struct::n_def

number of columns defined so far

Definition at line 494 of file dict0mem.h.

◆ n_foreign_key_checks_running

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 531 of file dict0mem.h.

◆ n_mysql_handles_opened

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 519 of file dict0mem.h.

◆ n_waiting_or_granted_auto_inc_locks

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 622 of file dict0mem.h.

◆ name

char* dict_table_struct::name

table name

Definition at line 471 of file dict0mem.h.

◆ name_hash

hash_node_t dict_table_struct::name_hash

hash chain node

Definition at line 506 of file dict0mem.h.

◆ query_cache_inv_trx_id

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 537 of file dict0mem.h.

◆ referenced_list

dict_table_struct::referenced_list

list of foreign key constraints which refer to this table

Definition at line 515 of file dict0mem.h.

◆ space

unsigned dict_table_struct::space

space where the clustered index of the table is placed

Definition at line 478 of file dict0mem.h.

◆ stat_clustered_index_size

ulint dict_table_struct::stat_clustered_index_size

approximate clustered index size in database pages

Definition at line 574 of file dict0mem.h.

◆ stat_initialized

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 568 of file dict0mem.h.

◆ stat_modified_counter

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 579 of file dict0mem.h.

◆ stat_n_rows

ib_int64_t dict_table_struct::stat_n_rows

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

Definition at line 571 of file dict0mem.h.

◆ stat_sum_of_other_index_sizes

ulint dict_table_struct::stat_sum_of_other_index_sizes

other indexes in database pages

Definition at line 577 of file dict0mem.h.

◆ table_LRU

dict_table_struct::table_LRU

node of the LRU list of tables

Definition at line 518 of file dict0mem.h.

◆ tablespace_discarded

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 487 of file dict0mem.h.


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