mysql
Schema- Grant system tables
- Cluster status system tables
- Server-side help system tables
- Statistics system tables
- Execution plan-related system tables
- GC worker system tables
- System tables related to cached tables
- TTL related system tables
- System tables related to metadata locks
- System tables related to DDL statements
- Miscellaneous system tables
mysql
Schema
The mysql
schema contains TiDB system tables. The design is similar to the mysql
schema in MySQL, where tables such as mysql.user
can be edited directly. It also contains a number of tables which are extensions to MySQL.
Grant system tables
These system tables contain grant information about user accounts and their privileges:
user
: user accounts, global privileges, and other non-privilege columnsdb
: database-level privilegestables_priv
: table-level privilegescolumns_priv
: column-level privilegespassword_history
: password change historydefault_roles
: the default roles for a userglobal_grants
: dynamic privilegesglobal_priv
: the authentication information based on certificatesrole_edges
: the relationship between roles
Cluster status system tables
The
tidb
table contains some global information about TiDB:bootstrapped
: whether the TiDB cluster has been initialized. Note that this value is read-only and cannot be modified.tidb_server_version
: the version information of TiDB when it is initialized. Note that this value is read-only and cannot be modified.system_tz
: the system time zone of TiDB.new_collation_enabled
: whether TiDB has enabled the new framework for collations. Note that this value is read-only and cannot be modified.
Server-side help system tables
Currently, the help_topic
is NULL.
Statistics system tables
stats_buckets
: the buckets of statisticsstats_histograms
: the histograms of statisticsstats_top_n
: the TopN of statisticsstats_meta
: the meta information of tables, such as the total number of rows and updated rowsstats_extended
: extended statistics, such as the order correlation between columnsstats_feedback
: the query feedback of statisticsstats_fm_sketch
: the FMSketch distribution of the histogram of the statistics columnanalyze_options
: the defaultanalyze
options for each tablecolumn_stats_usage
: the usage of column statisticsschema_index_usage
: the usage of indexesanalyze_jobs
: the ongoing statistics collection tasks and the history task records within the last 7 days
Execution plan-related system tables
bind_info
: the binding information of execution planscapture_plan_baselines_blacklist
: the blocklist for the automatic binding of the execution plan
GC worker system tables
Note
The GC worker system tables are only applicable to TiDB Self-Hosted and not available on TiDB Cloud.
gc_delete_range
: the KV range to be deletedgc_delete_range_done
: the deleted KV range
System tables related to cached tables
table_cache_meta
: stores the metadata of cached tables
TTL related system tables
Note
The TTL related system tables are not available on TiDB Serverless clusters.
mysql.tidb_ttl_table_status
the previously executed TTL job and ongoing TTL job for all TTL tablesmysql.tidb_ttl_task
the current ongoing TTL subtasksmysql.tidb_ttl_job_history
the execution history of TTL tasks in the last 90 days
System tables related to metadata locks
tidb_mdl_view
:a view of metadata locks. You can use it to view information about the currently blocked DDL statementstidb_mdl_info
:used internally by TiDB to synchronize metadata locks across nodes
System tables related to DDL statements
tidb_ddl_history
: the history records of DDL statementstidb_ddl_jobs
: the metadata of DDL statements that are currently being executed by TiDBtidb_ddl_reorg
: the metadata of physical DDL statements (such as adding indexes) that are currently being executed by TiDB
Miscellaneous system tables
Note
The tidb
, expr_pushdown_blacklist
, opt_rule_blacklist
, and table_cache_meta
system tables are only applicable to TiDB Self-Hosted and not available on TiDB Cloud.
GLOBAL_VARIABLES
: global system variable tableexpr_pushdown_blacklist
: the blocklist for expression pushdownopt_rule_blacklist
: the blocklist for logical optimization rulestidb_timers
: the metadata of internal timers