Table of Contents
- 26.1 Introduction
- 26.2 The INFORMATION_SCHEMA ADMINISTRABLE_ROLE_AUTHORIZATIONS Table
- 26.3 The INFORMATION_SCHEMA APPLICABLE_ROLES Table
- 26.4 The INFORMATION_SCHEMA CHARACTER_SETS Table
- 26.5 The INFORMATION_SCHEMA CHECK_CONSTRAINTS Table
- 26.6 The INFORMATION_SCHEMA COLLATIONS Table
- 26.7 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table
- 26.8 The INFORMATION_SCHEMA COLUMNS Table
- 26.9 The INFORMATION_SCHEMA COLUMNS_EXTENSIONS Table
- 26.10 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table
- 26.11 The INFORMATION_SCHEMA COLUMN_STATISTICS Table
- 26.12 The INFORMATION_SCHEMA ENABLED_ROLES Table
- 26.13 The INFORMATION_SCHEMA ENGINES Table
- 26.14 The INFORMATION_SCHEMA EVENTS Table
- 26.15 The INFORMATION_SCHEMA FILES Table
- 26.16 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table
- 26.17 The INFORMATION_SCHEMA ndb_transid_mysql_connection_map Table
- 26.18 The INFORMATION_SCHEMA KEYWORDS Table
- 26.19 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table
- 26.20 The INFORMATION_SCHEMA PARAMETERS Table
- 26.21 The INFORMATION_SCHEMA PARTITIONS Table
- 26.22 The INFORMATION_SCHEMA PLUGINS Table
- 26.23 The INFORMATION_SCHEMA PROCESSLIST Table
- 26.24 The INFORMATION_SCHEMA PROFILING Table
- 26.25 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table
- 26.26 The INFORMATION_SCHEMA RESOURCE_GROUPS Table
- 26.27 The INFORMATION_SCHEMA ROLE_COLUMN_GRANTS Table
- 26.28 The INFORMATION_SCHEMA ROLE_ROUTINE_GRANTS Table
- 26.29 The INFORMATION_SCHEMA ROLE_TABLE_GRANTS Table
- 26.30 The INFORMATION_SCHEMA ROUTINES Table
- 26.31 The INFORMATION_SCHEMA SCHEMATA Table
- 26.32 The INFORMATION_SCHEMA SCHEMATA_EXTENSIONS Table
- 26.33 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table
- 26.34 The INFORMATION_SCHEMA STATISTICS Table
- 26.35 The INFORMATION_SCHEMA ST_GEOMETRY_COLUMNS Table
- 26.36 The INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS Table
- 26.37 The INFORMATION_SCHEMA ST_UNITS_OF_MEASURE Table
- 26.38 The INFORMATION_SCHEMA TABLES Table
- 26.39 The INFORMATION_SCHEMA TABLES_EXTENSIONS Table
- 26.40 The INFORMATION_SCHEMA TABLESPACES Table
- 26.41 The INFORMATION_SCHEMA TABLESPACES_EXTENSIONS Table
- 26.42 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table
- 26.43 The INFORMATION_SCHEMA TABLE_CONSTRAINTS_EXTENSIONS Table
- 26.44 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table
- 26.45 The INFORMATION_SCHEMA TRIGGERS Table
- 26.46 The INFORMATION_SCHEMA USER_ATTRIBUTES Table
- 26.47 The INFORMATION_SCHEMA USER_PRIVILEGES Table
- 26.48 The INFORMATION_SCHEMA VIEWS Table
- 26.49 The INFORMATION_SCHEMA VIEW_ROUTINE_USAGE Table
- 26.50 The INFORMATION_SCHEMA VIEW_TABLE_USAGE Table
- 26.51 INFORMATION_SCHEMA InnoDB Tables
- 26.51.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table
- 26.51.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table
- 26.51.3 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table
- 26.51.4 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table
- 26.51.5 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables
- 26.51.6 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables
- 26.51.7 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables
- 26.51.8 The INFORMATION_SCHEMA INNODB_COLUMNS Table
- 26.51.9 The INFORMATION_SCHEMA INNODB_DATAFILES Table
- 26.51.10 The INFORMATION_SCHEMA INNODB_FIELDS Table
- 26.51.11 The INFORMATION_SCHEMA INNODB_FOREIGN Table
- 26.51.12 The INFORMATION_SCHEMA INNODB_FOREIGN_COLS Table
- 26.51.13 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table
- 26.51.14 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table
- 26.51.15 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table
- 26.51.16 The INFORMATION_SCHEMA INNODB_FT_DELETED Table
- 26.51.17 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table
- 26.51.18 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table
- 26.51.19 The INFORMATION_SCHEMA INNODB_INDEXES Table
- 26.51.20 The INFORMATION_SCHEMA INNODB_LOCKS Table
- 26.51.21 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table
- 26.51.22 The INFORMATION_SCHEMA INNODB_METRICS Table
- 26.51.23 The INFORMATION_SCHEMA INNODB_SESSION_TEMP_TABLESPACES Table
- 26.51.24 The INFORMATION_SCHEMA INNODB_TABLES Table
- 26.51.25 The INFORMATION_SCHEMA INNODB_TABLESPACES Table
- 26.51.26 The INFORMATION_SCHEMA INNODB_TABLESPACES_BRIEF Table
- 26.51.27 The INFORMATION_SCHEMA INNODB_TABLESTATS View
- 26.51.28 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table
- 26.51.29 The INFORMATION_SCHEMA INNODB_TRX Table
- 26.51.30 The INFORMATION_SCHEMA INNODB_VIRTUAL Table
- 26.52 INFORMATION_SCHEMA Thread Pool Tables
- 26.53 INFORMATION_SCHEMA Connection-Control Tables
- 26.54 INFORMATION_SCHEMA MySQL Enterprise Firewall Tables
- 26.55 Extensions to SHOW Statements
INFORMATION_SCHEMA provides access to database
metadata, information about
the MySQL server such as the name of a database or table, the data
type of a column, or access privileges. Other terms that are
sometimes used for this information are
data dictionary and
system catalog.
INFORMATION_SCHEMA provides access to database
metadata, information about
the MySQL server such as the name of a database or table, the data
type of a column, or access privileges. Other terms that are
sometimes used for this information are
data dictionary and
system catalog.
INFORMATION_SCHEMA is a database within each
MySQL instance, the place that stores information about all the
other databases that the MySQL server maintains. The
INFORMATION_SCHEMA database contains several
read-only tables. They are actually views, not base tables, so
there are no files associated with them, and you cannot set
triggers on them. Also, there is no database directory with that
name.
Although you can select INFORMATION_SCHEMA as
the default database with a USE
statement, you can only read the contents of tables, not perform
INSERT,
UPDATE, or
DELETE operations on them.
Here is an example of a statement that retrieves information
from INFORMATION_SCHEMA:
mysql>SELECT table_name, table_type, engineFROM information_schema.tablesWHERE table_schema = 'db5'ORDER BY table_name;+------------+------------+--------+ | table_name | table_type | engine | +------------+------------+--------+ | fk | BASE TABLE | InnoDB | | fk2 | BASE TABLE | InnoDB | | goto | BASE TABLE | MyISAM | | into | BASE TABLE | MyISAM | | k | BASE TABLE | MyISAM | | kurs | BASE TABLE | MyISAM | | loop | BASE TABLE | MyISAM | | pk | BASE TABLE | InnoDB | | t | BASE TABLE | MyISAM | | t2 | BASE TABLE | MyISAM | | t3 | BASE TABLE | MyISAM | | t7 | BASE TABLE | MyISAM | | tables | BASE TABLE | MyISAM | | v | VIEW | NULL | | v2 | VIEW | NULL | | v3 | VIEW | NULL | | v56 | VIEW | NULL | +------------+------------+--------+ 17 rows in set (0.01 sec)
Explanation: The statement requests a list of all the tables in
database db5, showing just three pieces of
information: the name of the table, its type, and its storage
engine.
The definition for character columns (for example,
TABLES.TABLE_NAME) is generally
VARCHAR( where N) CHARACTER SET
utf8N is at least
64. MySQL uses the default collation for this character set
(utf8_general_ci) for all searches, sorts,
comparisons, and other string operations on such columns.
Because some MySQL objects are represented as files, searches in
INFORMATION_SCHEMA string columns can be
affected by file system case sensitivity. For more information,
see Section 10.8.7, “Using Collation in INFORMATION_SCHEMA Searches”.
The SELECT ... FROM INFORMATION_SCHEMA
statement is intended as a more consistent way to provide access
to the information provided by the various
SHOW statements that MySQL
supports (SHOW DATABASES,
SHOW TABLES, and so forth). Using
SELECT has these advantages,
compared to SHOW:
It conforms to Codd's rules, because all access is done on tables.
You can use the familiar syntax of the
SELECTstatement, and only need to learn some table and column names.The implementor need not worry about adding keywords.
You can filter, sort, concatenate, and transform the results from
INFORMATION_SCHEMAqueries into whatever format your application needs, such as a data structure or a text representation to parse.This technique is more interoperable with other database systems. For example, Oracle Database users are familiar with querying tables in the Oracle data dictionary.
Because SHOW is familiar and
widely used, the SHOW statements
remain as an alternative. In fact, along with the implementation
of INFORMATION_SCHEMA, there are enhancements
to SHOW as described in
Section 26.55, “Extensions to SHOW Statements”.
For most INFORMATION_SCHEMA tables, each
MySQL user has the right to access them, but can see only the
rows in the tables that correspond to objects for which the user
has the proper access privileges. In some cases (for example,
the ROUTINE_DEFINITION column in the
INFORMATION_SCHEMA
ROUTINES table), users who have
insufficient privileges see NULL. Some tables
have different privilege requirements; for these, the
requirements are mentioned in the applicable table descriptions.
For example, InnoDB tables (tables
with names that begin with INNODB_) require
the PROCESS privilege.
The same privileges apply to selecting information from
INFORMATION_SCHEMA and viewing the same
information through SHOW
statements. In either case, you must have some privilege on an
object to see information about it.
INFORMATION_SCHEMA queries that search for
information from more than one database might take a long time
and impact performance. To check the efficiency of a query, you
can use EXPLAIN. For information
about using EXPLAIN output to
tune INFORMATION_SCHEMA queries, see
Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”.
The implementation for the INFORMATION_SCHEMA
table structures in MySQL follows the ANSI/ISO SQL:2003 standard
Part 11 Schemata. Our intent is
approximate compliance with SQL:2003 core feature F021
Basic information schema.
Users of SQL Server 2000 (which also follows the standard) may
notice a strong similarity. However, MySQL has omitted many
columns that are not relevant for our implementation, and added
columns that are MySQL-specific. One such added column is the
ENGINE column in the
INFORMATION_SCHEMA
TABLES table.
Although other DBMSs use a variety of names, like
syscat or system, the
standard name is INFORMATION_SCHEMA.
To avoid using any name that is reserved in the standard or in
DB2, SQL Server, or Oracle, we changed the names of some columns
marked “MySQL extension”. (For example, we changed
COLLATION to
TABLE_COLLATION in the
TABLES table.) See the list of
reserved words near the end of this article:
https://web.archive.org/web/20070428032454/http://www.dbazine.com/db2/db2-disarticles/gulutzan5.
The following sections describe each of the tables and columns
in INFORMATION_SCHEMA. For each column, there
are three pieces of information:
“
INFORMATION_SCHEMAName” indicates the name for the column in theINFORMATION_SCHEMAtable. This corresponds to the standard SQL name unless the “Remarks” field says “MySQL extension.”“
SHOWName” indicates the equivalent field name in the closestSHOWstatement, if there is one.“Remarks” provides additional information where applicable. If this field is
NULL, it means that the value of the column is alwaysNULL. If this field says “MySQL extension,” the column is a MySQL extension to standard SQL.
Many sections indicate what SHOW
statement is equivalent to a
SELECT that retrieves information
from INFORMATION_SCHEMA. For
SHOW statements that display
information for the default database if you omit a FROM
clause, you can
often select information for the default database by adding an
db_nameAND TABLE_SCHEMA = SCHEMA() condition to the
WHERE clause of a query that retrieves
information from an INFORMATION_SCHEMA table.
These sections discuss additional
INFORMATION_SCHEMA-related topics:
information about
INFORMATION_SCHEMAtables specific to theInnoDBstorage engine: Section 26.51, “INFORMATION_SCHEMA InnoDB Tables”information about
INFORMATION_SCHEMAtables specific to the thread pool plugin: Section 26.52, “INFORMATION_SCHEMA Thread Pool Tables”information about
INFORMATION_SCHEMAtables specific to theCONNECTION_CONTROLplugin: Section 26.53, “INFORMATION_SCHEMA Connection-Control Tables”Answers to questions that are often asked concerning the
INFORMATION_SCHEMAdatabase: Section A.7, “MySQL 8.0 FAQ: INFORMATION_SCHEMA”INFORMATION_SCHEMAqueries and the optimizer: Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”The effect of collation on
INFORMATION_SCHEMAcomparisons: Section 10.8.7, “Using Collation in INFORMATION_SCHEMA Searches”
The ADMINISTRABLE_ROLE_AUTHORIZATIONS
table (available as of MySQL 8.0.19) provides information about
which roles applicable for the current user or role can be granted
to other users or roles.
The ADMINISTRABLE_ROLE_AUTHORIZATIONS
table has these columns:
USERThe user name part of the current user account.
HOSTThe host name part of the current user account.
GRANTEEThe user name part of the account to which the role is granted.
GRANTEE_HOSTThe host name part of the account to which the role is granted.
ROLE_NAMEThe user name part of the granted role.
ROLE_HOSTThe host name part of the granted role.
IS_GRANTABLEYESorNO, depending on whether the role is grantable to other accounts.IS_DEFAULTYESorNO, depending on whether the role is a default role.IS_MANDATORYYESorNO, depending on whether the role is mandatory.
The APPLICABLE_ROLES table (available
as of MySQL 8.0.19) provides information about the roles that are
applicable for the current user.
The APPLICABLE_ROLES table has these
columns:
USERThe user name part of the current user account.
HOSTThe host name part of the current user account.
GRANTEEThe user name part of the account to which the role is granted.
GRANTEE_HOSTThe host name part of the account to which the role is granted.
ROLE_NAMEThe user name part of the granted role.
ROLE_HOSTThe host name part of the granted role.
IS_GRANTABLEYESorNO, depending on whether the role is grantable to other accounts.IS_DEFAULTYESorNO, depending on whether the role is a default role.IS_MANDATORYYESorNO, depending on whether the role is mandatory.
The CHARACTER_SETS table provides
information about available character sets.
The CHARACTER_SETS table has these
columns:
CHARACTER_SET_NAMEThe character set name.
DEFAULT_COLLATE_NAMEThe default collation for the character set.
DESCRIPTIONA description of the character set.
MAXLENThe maximum number of bytes required to store one character.
Notes
Character set information is also available from the
SHOW CHARACTER SET statement. See
Section 13.7.7.3, “SHOW CHARACTER SET Statement”. The following statements are
equivalent:
SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS [WHERE CHARACTER_SET_NAME LIKE 'wild'] SHOW CHARACTER SET [LIKE 'wild']
The CHECK_CONSTRAINTS table
(available as of MySQL 8.0.16) provides information about
CHECK constraints defined on tables.
The CHECK_CONSTRAINTS table has these
columns:
CONSTRAINT_CATALOGThe name of the catalog to which the constraint belongs. This value is always
def.CONSTRAINT_SCHEMAThe name of the schema (database) to which the constraint belongs.
CONSTRAINT_NAMEThe name of the constraint.
CHECK_CLAUSEThe expression that specifies the constraint condition.
The COLLATIONS table provides
information about collations for each character set.
The COLLATIONS table has these
columns:
COLLATION_NAMEThe collation name.
CHARACTER_SET_NAMEThe name of the character set with which the collation is associated.
IDThe collation ID.
IS_DEFAULTWhether the collation is the default for its character set.
IS_COMPILEDWhether the character set is compiled into the server.
SORTLENThis is related to the amount of memory required to sort strings expressed in the character set.
PAD_ATTRIBUTEThe collation pad attribute, either
NO PADorPAD SPACE. This attribute affects whether trailing spaces are significant in string comparisons; see Trailing Space Handling in Comparisons.
Notes
Collation information is also available from the
SHOW COLLATION statement. See
Section 13.7.7.4, “SHOW COLLATION Statement”. The following statements are
equivalent:
SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS [WHERE COLLATION_NAME LIKE 'wild'] SHOW COLLATION [LIKE 'wild']
The
COLLATION_CHARACTER_SET_APPLICABILITY
table indicates what character set is applicable for what
collation.
The
COLLATION_CHARACTER_SET_APPLICABILITY
table has these columns:
COLLATION_NAMEThe collation name.
CHARACTER_SET_NAMEThe name of the character set with which the collation is associated.
Notes
The
COLLATION_CHARACTER_SET_APPLICABILITY
columns are equivalent to the first two columns displayed by the
SHOW COLLATION statement.
The COLUMNS table provides
information about columns in tables. The related
ST_GEOMETRY_COLUMNS table provides
information about table columns that store spatial data. See
Section 26.35, “The INFORMATION_SCHEMA ST_GEOMETRY_COLUMNS Table”.
The COLUMNS table has these columns:
TABLE_CATALOGThe name of the catalog to which the table containing the column belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table containing the column belongs.
TABLE_NAMEThe name of the table containing the column.
COLUMN_NAMEThe name of the column.
ORDINAL_POSITIONThe position of the column within the table.
ORDINAL_POSITIONis necessary because you might want to sayORDER BY ORDINAL_POSITION. UnlikeSHOW COLUMNS,SELECTfrom theCOLUMNStable does not have automatic ordering.COLUMN_DEFAULTThe default value for the column. This is
NULLif the column has an explicit default ofNULL, or if the column definition includes noDEFAULTclause.IS_NULLABLEThe column nullability. The value is
YESifNULLvalues can be stored in the column,NOif not.DATA_TYPEThe column data type.
The
DATA_TYPEvalue is the type name only with no other information. TheCOLUMN_TYPEvalue contains the type name and possibly other information such as the precision or length.CHARACTER_MAXIMUM_LENGTHFor string columns, the maximum length in characters.
CHARACTER_OCTET_LENGTHFor string columns, the maximum length in bytes.
NUMERIC_PRECISIONFor numeric columns, the numeric precision.
NUMERIC_SCALEFor numeric columns, the numeric scale.
DATETIME_PRECISIONFor temporal columns, the fractional seconds precision.
CHARACTER_SET_NAMEFor character string columns, the character set name.
COLLATION_NAMEFor character string columns, the collation name.
COLUMN_TYPEThe column data type.
The
DATA_TYPEvalue is the type name only with no other information. TheCOLUMN_TYPEvalue contains the type name and possibly other information such as the precision or length.COLUMN_KEYWhether the column is indexed:
If
COLUMN_KEYis empty, the column either is not indexed or is indexed only as a secondary column in a multiple-column, nonunique index.If
COLUMN_KEYisPRI, the column is aPRIMARY KEYor is one of the columns in a multiple-columnPRIMARY KEY.If
COLUMN_KEYisUNI, the column is the first column of aUNIQUEindex. (AUNIQUEindex permits multipleNULLvalues, but you can tell whether the column permitsNULLby checking theNullcolumn.)If
COLUMN_KEYisMUL, the column is the first column of a nonunique index in which multiple occurrences of a given value are permitted within the column.
If more than one of the
COLUMN_KEYvalues applies to a given column of a table,COLUMN_KEYdisplays the one with the highest priority, in the orderPRI,UNI,MUL.A
UNIQUEindex may be displayed asPRIif it cannot containNULLvalues and there is noPRIMARY KEYin the table. AUNIQUEindex may display asMULif several columns form a compositeUNIQUEindex; although the combination of the columns is unique, each column can still hold multiple occurrences of a given value.EXTRAAny additional information that is available about a given column. The value is nonempty in these cases:
auto_incrementfor columns that have theAUTO_INCREMENTattribute.on update CURRENT_TIMESTAMPforTIMESTAMPorDATETIMEcolumns that have theON UPDATE CURRENT_TIMESTAMPattribute.STORED GENERATEDorVIRTUAL GENERATEDfor generated columns.DEFAULT_GENERATEDfor columns that have an expression default value.
PRIVILEGESThe privileges you have for the column.
COLUMN_COMMENTAny comment included in the column definition.
GENERATION_EXPRESSIONFor generated columns, displays the expression used to compute column values. Empty for nongenerated columns. For information about generated columns, see Section 13.1.20.8, “CREATE TABLE and Generated Columns”.
SRS_IDThis value applies to spatial columns. It contains the column
SRIDvalue that indicates the spatial reference system for values stored in the column. See Section 11.4.1, “Spatial Data Types”, and Section 11.4.5, “Spatial Reference System Support”. The value isNULLfor nonspatial columns and spatial columns with noSRIDattribute.
Notes
In
SHOW COLUMNS, theTypedisplay includes values from several differentCOLUMNScolumns.CHARACTER_OCTET_LENGTHshould be the same asCHARACTER_MAXIMUM_LENGTH, except for multibyte character sets.CHARACTER_SET_NAMEcan be derived fromCOLLATION_NAME. For example, if you saySHOW FULL COLUMNS FROM t, and you see in theCOLLATION_NAMEcolumn a value ofutf8_swedish_ci, the character set is what is before the first underscore:utf8.
Column information is also available from the
SHOW COLUMNS statement. See
Section 13.7.7.5, “SHOW COLUMNS Statement”. The following statements are
nearly equivalent:
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tbl_name' [AND table_schema = 'db_name'] [AND column_name LIKE 'wild'] SHOW COLUMNS FROMtbl_name[FROMdb_name] [LIKE 'wild']
The COLUMNS_EXTENSIONS table (available as of
MySQL 8.0.21) provides information about column attributes defined
for primary and secondary storage engines.
The COLUMNS_EXTENSIONS table is
reserved for future use.
The COLUMNS_EXTENSIONS table has
these columns:
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table.
COLUMN_NAMEThe name of the column.
ENGINE_ATTRIBUTEColumn attributes defined for the primary storage engine. Reserved for future use.
SECONDARY_ENGINE_ATTRIBUTEColumn attributes defined for the secondary storage engine. Reserved for future use.
The COLUMN_PRIVILEGES table provides
information about column privileges. It takes its values from the
mysql.columns_priv system table.
The COLUMN_PRIVILEGES table has these
columns:
GRANTEEThe name of the account to which the privilege is granted, in
'format.user_name'@'host_name'TABLE_CATALOGThe name of the catalog to which the table containing the column belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table containing the column belongs.
TABLE_NAMEThe name of the table containing the column.
COLUMN_NAMEThe name of the column.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the column level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per column privilege held by the grantee.
In the output from
SHOW FULL COLUMNS, the privileges are all in one column and in lowercase, for example,select,insert,update,references. InCOLUMN_PRIVILEGES, there is one privilege per row, in uppercase.IS_GRANTABLEYESif the user has theGRANT OPTIONprivilege,NOotherwise. The output does not listGRANT OPTIONas a separate row withPRIVILEGE_TYPE='GRANT OPTION'.
Notes
COLUMN_PRIVILEGESis a nonstandardINFORMATION_SCHEMAtable.
The following statements are not equivalent:
SELECT ... FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES SHOW GRANTS ...
The COLUMN_STATISTICS table provides
access to histogram statistics for column values.
For information about histogram statistics, see Section 8.9.6, “Optimizer Statistics”, and Section 13.7.3.1, “ANALYZE TABLE Statement”.
You can see information only for columns for which you have some privilege.
The COLUMN_STATISTICS table has these
columns:
SCHEMA_NAMEThe names of the schema for which the statistics apply.
TABLE_NAMEThe names of the column for which the statistics apply.
COLUMN_NAMEThe names of the column for which the statistics apply.
HISTOGRAMA
JSONobject describing the column statistics, stored as a histogram.
The ENABLED_ROLES table (available as
of MySQL 8.0.19) provides information about the roles that are
enabled within the current session.
The ENABLED_ROLES table has these
columns:
ROLE_NAMEThe user name part of the granted role.
ROLE_HOSTThe host name part of the granted role.
IS_DEFAULTYESorNO, depending on whether the role is a default role.IS_MANDATORYYESorNO, depending on whether the role is mandatory.
The ENGINES table provides
information about storage engines. This is particularly useful for
checking whether a storage engine is supported, or to see what the
default engine is.
The ENGINES table has these columns:
ENGINEThe name of the storage engine.
SUPPORTThe server's level of support for the storage engine, as shown in the following table.
Value Meaning YESThe engine is supported and is active DEFAULTLike YES, plus this is the default engineNOThe engine is not supported DISABLEDThe engine is supported but has been disabled A value of
NOmeans that the server was compiled without support for the engine, so it cannot be enabled at runtime.A value of
DISABLEDoccurs either because the server was started with an option that disables the engine, or because not all options required to enable it were given. In the latter case, the error log should contain a reason indicating why the option is disabled. See Section 5.4.2, “The Error Log”.You might also see
DISABLEDfor a storage engine if the server was compiled to support it, but was started with a--skip-option. For theengine_nameNDBstorage engine,DISABLEDmeans the server was compiled with support for NDB Cluster, but was not started with the--ndbclusteroption.All MySQL servers support
MyISAMtables. It is not possible to disableMyISAM.COMMENTA brief description of the storage engine.
TRANSACTIONSWhether the storage engine supports transactions.
XAWhether the storage engine supports XA transactions.
SAVEPOINTSWhether the storage engine supports savepoints.
Notes
ENGINESis a nonstandardINFORMATION_SCHEMAtable.
Storage engine information is also available from the
SHOW ENGINES statement. See
Section 13.7.7.16, “SHOW ENGINES Statement”. The following statements are
equivalent:
SELECT * FROM INFORMATION_SCHEMA.ENGINES SHOW ENGINES
The EVENTS table provides information
about Event Manager events, which are discussed in
Section 25.4, “Using the Event Scheduler”.
The EVENTS table has these columns:
EVENT_CATALOGThe name of the catalog to which the event belongs. This value is always
def.EVENT_SCHEMAThe name of the schema (database) to which the event belongs.
EVENT_NAMEThe name of the event.
DEFINERThe account named in the
DEFINERclause (often the user who created the event), in'format.user_name'@'host_name'TIME_ZONEThe event time zone, which is the time zone used for scheduling the event and that is in effect within the event as it executes. The default value is
SYSTEM.EVENT_BODYThe language used for the statements in the event's
DOclause. The value is alwaysSQL.EVENT_DEFINITIONThe text of the SQL statement making up the event's
DOclause; in other words, the statement executed by this event.EVENT_TYPEThe event repetition type, either
ONE TIME(transient) orRECURRING(repeating).EXECUTE_ATFor a one-time event, this is the
DATETIMEvalue specified in theATclause of theCREATE EVENTstatement used to create the event, or of the lastALTER EVENTstatement that modified the event. The value shown in this column reflects the addition or subtraction of anyINTERVALvalue included in the event'sATclause. For example, if an event is created usingON SCHEDULE AT CURRENT_TIMESTAMP + '1:6' DAY_HOUR, and the event was created at 2018-02-09 14:05:30, the value shown in this column would be'2018-02-10 20:05:30'. If the event's timing is determined by anEVERYclause instead of anATclause (that is, if the event is recurring), the value of this column isNULL.INTERVAL_VALUEFor a recurring event, the number of intervals to wait between event executions. For a transient event, the value is always
NULL.INTERVAL_FIELDThe time units used for the interval which a recurring event waits before repeating. For a transient event, the value is always
NULL.SQL_MODEThe SQL mode in effect when the event was created or altered, and under which the event executes. For the permitted values, see Section 5.1.11, “Server SQL Modes”.
STARTSThe start date and time for a recurring event. This is displayed as a
DATETIMEvalue, and isNULLif no start date and time are defined for the event. For a transient event, this column is alwaysNULL. For a recurring event whose definition includes aSTARTSclause, this column contains the correspondingDATETIMEvalue. As with theEXECUTE_ATcolumn, this value resolves any expressions used. If there is noSTARTSclause affecting the timing of the event, this column isNULLENDSFor a recurring event whose definition includes a
ENDSclause, this column contains the correspondingDATETIMEvalue. As with theEXECUTE_ATcolumn, this value resolves any expressions used. If there is noENDSclause affecting the timing of the event, this column isNULL.STATUSThe event status. One of
ENABLED,DISABLED, orSLAVESIDE_DISABLED.SLAVESIDE_DISABLEDindicates that the creation of the event occurred on another MySQL server acting as a replication source and replicated to the current MySQL server which is acting as a replica, but the event is not presently being executed on the replica. For more information, see Section 17.5.1.16, “Replication of Invoked Features”. information.ON_COMPLETIONOne of the two values
PRESERVEorNOT PRESERVE.CREATEDThe date and time when the event was created. This is a
TIMESTAMPvalue.LAST_ALTEREDThe date and time when the event was last modified. This is a
TIMESTAMPvalue. If the event has not been modified since its creation, this value is the same as theCREATEDvalue.LAST_EXECUTEDThe date and time when the event last executed. This is a
DATETIMEvalue. If the event has never executed, this column isNULL.LAST_EXECUTEDindicates when the event started. As a result, theENDScolumn is never less thanLAST_EXECUTED.EVENT_COMMENTThe text of the comment, if the event has one. If not, this value is empty.
ORIGINATORThe server ID of the MySQL server on which the event was created; used in replication. This value may be updated by
ALTER EVENTto the server ID of the server on which that statement occurs, if executed on a replication source. The default value is 0.CHARACTER_SET_CLIENTThe session value of the
character_set_clientsystem variable when the event was created.COLLATION_CONNECTIONThe session value of the
collation_connectionsystem variable when the event was created.DATABASE_COLLATIONThe collation of the database with which the event is associated.
Notes
EVENTSis a nonstandardINFORMATION_SCHEMAtable.Times in the
EVENTStable are displayed using the event time zone, the current session time zone, or UTC, as described in Section 25.4.4, “Event Metadata”.For more information about
SLAVESIDE_DISABLEDand theORIGINATORcolumn, see Section 17.5.1.16, “Replication of Invoked Features”.
Example
Suppose that the user 'jon'@'ghidora' creates
an event named e_daily, and then modifies it a
few minutes later using an ALTER
EVENT statement, as shown here:
DELIMITER |
CREATE EVENT e_daily
ON SCHEDULE
EVERY 1 DAY
COMMENT 'Saves total number of sessions then clears the table each day'
DO
BEGIN
INSERT INTO site_activity.totals (time, total)
SELECT CURRENT_TIMESTAMP, COUNT(*)
FROM site_activity.sessions;
DELETE FROM site_activity.sessions;
END |
DELIMITER ;
ALTER EVENT e_daily
ENABLE;
(Note that comments can span multiple lines.)
This user can then run the following
SELECT statement, and obtain the
output shown:
mysql>SELECT * FROM INFORMATION_SCHEMA.EVENTSWHERE EVENT_NAME = 'e_daily'AND EVENT_SCHEMA = 'myschema'\G*************************** 1. row *************************** EVENT_CATALOG: def EVENT_SCHEMA: myschema EVENT_NAME: e_daily DEFINER: jon@ghidora TIME_ZONE: SYSTEM EVENT_BODY: SQL EVENT_DEFINITION: BEGIN INSERT INTO site_activity.totals (time, total) SELECT CURRENT_TIMESTAMP, COUNT(*) FROM site_activity.sessions; DELETE FROM site_activity.sessions; END EVENT_TYPE: RECURRING EXECUTE_AT: NULL INTERVAL_VALUE: 1 INTERVAL_FIELD: DAY SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES, NO_ZERO_IN_DATE,NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION STARTS: 2018-08-08 11:06:34 ENDS: NULL STATUS: ENABLED ON_COMPLETION: NOT PRESERVE CREATED: 2018-08-08 11:06:34 LAST_ALTERED: 2018-08-08 11:06:34 LAST_EXECUTED: 2018-08-08 16:06:34 EVENT_COMMENT: Saves total number of sessions then clears the table each day ORIGINATOR: 1 CHARACTER_SET_CLIENT: utf8mb4 COLLATION_CONNECTION: utf8mb4_0900_ai_ci DATABASE_COLLATION: utf8mb4_0900_ai_ci
Event information is also available from the
SHOW EVENTS statement. See
Section 13.7.7.18, “SHOW EVENTS Statement”. The following statements are
equivalent:
SELECT
EVENT_SCHEMA, EVENT_NAME, DEFINER, TIME_ZONE, EVENT_TYPE, EXECUTE_AT,
INTERVAL_VALUE, INTERVAL_FIELD, STARTS, ENDS, STATUS, ORIGINATOR,
CHARACTER_SET_CLIENT, COLLATION_CONNECTION, DATABASE_COLLATION
FROM INFORMATION_SCHEMA.EVENTS
WHERE table_schema = 'db_name'
[AND column_name LIKE 'wild']
SHOW EVENTS
[FROM db_name]
[LIKE 'wild']
The FILES table provides information
about the files in which MySQL tablespace data is stored.
The FILES table provides information
about InnoDB data files. In NDB Cluster, this
table also provides information about the files in which NDB
Cluster Disk Data tables are stored. For additional information
specific to InnoDB, see
InnoDB Notes, later in this section;
for additional information specific to NDB Cluster, see
NDB Notes.
The FILES table has these columns:
FILE_IDFor
InnoDB: The tablespace ID, also referred to as thespace_idorfil_space_t::id.For
NDB: A file identifier.FILE_IDcolumn values are auto-generated.FILE_NAMEFor
InnoDB: The name of the data file. File-per-table and general tablespaces have an.ibdfile name extension. Undo tablespaces are prefixed byundo. The system tablespace is prefixed byibdata. The global temporary tablespace is prefixed byibtmp. The file name includes the file path, which may be relative to the MySQL data directory (the value of thedatadirsystem variable).For
NDB: The name of an undo log file created byCREATE LOGFILE GROUPorALTER LOGFILE GROUP, or of a data file created byCREATE TABLESPACEorALTER TABLESPACE. In NDB 8.0, the file name is shown with a relative path; for an undo log file, this path is relative to the directory; for a data file, it is relative to the directoryDataDir/ndb_NodeId_fs/LG. This means, for example, that the name of a data file created withDataDir/ndb_NodeId_fs/TSALTER TABLESPACE ts ADD DATAFILE 'data_2.dat' INITIAL SIZE 256Mis shown as./data_2.dat.FILE_TYPEFor
InnoDB: The tablespace file type. There are three possible file types forInnoDBfiles.TABLESPACEis the file type for any system, general, or file-per-table tablespace file that holds tables, indexes, or other forms of user data.TEMPORARYis the file type for temporary tablespaces.UNDO LOGis the file type for undo tablespaces, which hold undo records.For
NDB: One of the valuesUNDO LOGorDATAFILE. Prior to NDB 8.0.13,TABLESPACEwas also a possible value.TABLESPACE_NAMEThe name of the tablespace with which the file is associated.
For
InnoDB: General tablespace names are as specified when created. File-per-table tablespace names are shown in the following format:. Theschema_name/table_nameInnoDBsystem tablespace name isinnodb_system. The global temporary tablespace name isinnodb_temporary. Default undo tablespace names areinnodb_undo_001andinnodb_undo_002. User-created undo tablespace names are as specified when created.TABLE_CATALOGThis value is always empty.
TABLE_SCHEMAThis is always
NULL.TABLE_NAMEThis is always
NULL.LOGFILE_GROUP_NAMEFor
InnoDB: This is alwaysNULL.For
NDB: The name of the log file group to which the log file or data file belongs.LOGFILE_GROUP_NUMBERFor
InnoDB: This is alwaysNULL.For
NDB: For a Disk Data undo log file, the auto-generated ID number of the log file group to which the log file belongs. This is the same as the value shown for theidcolumn in thendbinfo.dict_obj_infotable and thelog_idcolumn in thendbinfo.logspacesandndbinfo.logspacestables for this undo log file.ENGINEFor
InnoDB: This value is alwaysInnoDB.For
NDB: This value is alwaysndbcluster.FULLTEXT_KEYSThis is always
NULL.DELETED_ROWSThis is always
NULL.UPDATE_COUNTThis is always
NULL.FREE_EXTENTSFor
InnoDB: The number of fully free extents in the current data file.For
NDB: The number of extents which have not yet been used by the file.TOTAL_EXTENTSFor
InnoDB: The number of full extents used in the current data file. Any partial extent at the end of the file is not counted.For
NDB: The total number of extents allocated to the file.EXTENT_SIZEFor
InnoDB: Extent size is 1048576 (1MB) for files with a 4KB, 8KB, or 16KB page size. Extent size is 2097152 bytes (2MB) for files with a 32KB page size, and 4194304 (4MB) for files with a 64KB page size.FILESdoes not reportInnoDBpage size. Page size is defined by theinnodb_page_sizesystem variable. Extent size information can also be retrieved from theINNODB_TABLESPACEStable whereFILES.FILE_ID = INNODB_TABLESPACES.SPACE.For
NDB: The size of an extent for the file in bytes.INITIAL_SIZEFor
InnoDB: The initial size of the file in bytes.For
NDB: The size of the file in bytes. This is the same value that was used in theINITIAL_SIZEclause of theCREATE LOGFILE GROUP,ALTER LOGFILE GROUP,CREATE TABLESPACE, orALTER TABLESPACEstatement used to create the file.MAXIMUM_SIZEFor
InnoDB: The maximum number of bytes permitted in the file. The value isNULLfor all data files except for predefined system tablespace data files. Maximum system tablespace file size is defined byinnodb_data_file_path. Maximum global temporary tablespace file size is defined byinnodb_temp_data_file_path. ANULLvalue for a predefined system tablespace data file indicates that a file size limit was not defined explicitly.For
NDB: This value is always the same as theINITIAL_SIZEvalue.AUTOEXTEND_SIZEThe auto-extend size of the tablespace. For
NDB,AUTOEXTEND_SIZEis alwaysNULL.CREATION_TIMEThis is always
NULL.LAST_UPDATE_TIMEThis is always
NULL.LAST_ACCESS_TIMEThis is always
NULL.RECOVER_TIMEThis is always
NULL.TRANSACTION_COUNTERThis is always
NULL.VERSIONFor
InnoDB: This is alwaysNULL.For
NDB: The version number of the file.ROW_FORMATFor
InnoDB: This is alwaysNULL.For
NDB: One ofFIXEDorDYNAMIC.TABLE_ROWSThis is always
NULL.AVG_ROW_LENGTHThis is always
NULL.DATA_LENGTHThis is always
NULL.MAX_DATA_LENGTHThis is always
NULL.INDEX_LENGTHThis is always
NULL.DATA_FREEFor
InnoDB: The total amount of free space (in bytes) for the entire tablespace. Predefined system tablespaces, which include the system tablespace and temporary table tablespaces, may have one or more data files.For
NDB: This is alwaysNULL.CREATE_TIMEThis is always
NULL.UPDATE_TIMEThis is always
NULL.CHECK_TIMEThis is always
NULL.CHECKSUMThis is always
NULL.STATUSFor
InnoDB: This value isNORMALby default.InnoDBfile-per-table tablespaces may reportIMPORTING, which indicates that the tablespace is not yet available.For
NDB: For NDB Cluster Disk Data files, this value is alwaysNORMAL.EXTRAFor
InnoDB: This is alwaysNULL.For
NDB: (NDB 8.0.15 and later) For undo log files, this column shows the undo log buffer size; for data files, it is always NULL. A more detailed explanation is provided in the next few paragraphs.NDBCLUSTERstores a copy of each data file and each undo log file on each data node in the cluster. In NDB 8.0.13 and later, theFILEStable contains only one row for each such file. Suppose that you run the following two statements on an NDB Cluster with four data nodes:CREATE LOGFILE GROUP mygroup ADD UNDOFILE 'new_undo.dat' INITIAL_SIZE 2G ENGINE NDBCLUSTER; CREATE TABLESPACE myts ADD DATAFILE 'data_1.dat' USE LOGFILE GROUP mygroup INITIAL_SIZE 256M ENGINE NDBCLUSTER;After running these two statements successfully, you should see a result similar to the one shown here for this query against the
FILEStable:mysql>
SELECT LOGFILE_GROUP_NAME, FILE_TYPE, EXTRA->FROM INFORMATION_SCHEMA.FILES->WHERE ENGINE = 'ndbcluster';+--------------------+-----------+--------------------------+ | LOGFILE_GROUP_NAME | FILE_TYPE | EXTRA | +--------------------+-----------+--------------------------+ | mygroup | UNDO LOG | UNDO_BUFFER_SIZE=8388608 | | mygroup | DATAFILE | NULL | +--------------------+-----------+--------------------------+The undo log buffer size information was inadvertently removed in NDB 8.0.13, but was restored in NDB 8.0.15. (Bug #92796, Bug #28800252)
Prior to NDB 8.0.13, the
FILEStable contained a row for each of these files on each data node the file belonged to, as well as the size of its undo buffer. In these versions, the result of the same query contains one row per data node, as shown here:+--------------------+-----------+-----------------------------------------+ | LOGFILE_GROUP_NAME | FILE_TYPE | EXTRA | +--------------------+-----------+-----------------------------------------+ | mygroup | UNDO LOG | CLUSTER_NODE=5;UNDO_BUFFER_SIZE=8388608 | | mygroup | UNDO LOG | CLUSTER_NODE=6;UNDO_BUFFER_SIZE=8388608 | | mygroup | UNDO LOG | CLUSTER_NODE=7;UNDO_BUFFER_SIZE=8388608 | | mygroup | UNDO LOG | CLUSTER_NODE=8;UNDO_BUFFER_SIZE=8388608 | | mygroup | DATAFILE | CLUSTER_NODE=5 | | mygroup | DATAFILE | CLUSTER_NODE=6 | | mygroup | DATAFILE | CLUSTER_NODE=7 | | mygroup | DATAFILE | CLUSTER_NODE=8 | +--------------------+-----------+-----------------------------------------+
The following notes apply to InnoDB data
files.
Data reported by
FILESis reported from theInnoDBin-memory cache for open files. By comparison,INNODB_DATAFILESreports data from theInnoDBSYS_DATAFILESinternal data dictionary table.The data reported by
FILESincludes global temporary tablespace data. This data is not available in theInnoDBSYS_DATAFILESinternal data dictionary table, and is therefore not reported byINNODB_DATAFILES.Undo tablespace data is reported by
FILESwhen separate undo tablespaces are present, which they are by default in MySQL 8.0The following query returns all data pertinent to
InnoDBtablespaces.SELECT FILE_ID, FILE_NAME, FILE_TYPE, TABLESPACE_NAME, FREE_EXTENTS, TOTAL_EXTENTS, EXTENT_SIZE, INITIAL_SIZE, MAXIMUM_SIZE, AUTOEXTEND_SIZE, DATA_FREE, STATUS FROM INFORMATION_SCHEMA.FILES WHERE ENGINE='InnoDB'\G
The
FILEStable provides information about Disk Data files only; you cannot use it for determining disk space allocation or availability for individualNDBtables. However, it is possible to see how much space is allocated for eachNDBtable having data stored on disk—as well as how much remains available for storage of data on disk for that table—using ndb_desc.The
CREATION_TIME,LAST_UPDATE_TIME, andLAST_ACCESSEDvalues are as reported by the operating system, and are not supplied by theNDBstorage engine. Where no value is provided by the operating system, these columns displayNULL.The difference between the
TOTAL EXTENTSandFREE_EXTENTScolumns is the number of extents currently in use by the file:SELECT TOTAL_EXTENTS - FREE_EXTENTS AS extents_used FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = './myfile.dat';To approximate the amount of disk space in use by the file, multiply that difference by the value of the
EXTENT_SIZEcolumn, which gives the size of an extent for the file in bytes:SELECT (TOTAL_EXTENTS - FREE_EXTENTS) * EXTENT_SIZE AS bytes_used FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = './myfile.dat';Similarly, you can estimate the amount of space that remains available in a given file by multiplying
FREE_EXTENTSbyEXTENT_SIZE:SELECT FREE_EXTENTS * EXTENT_SIZE AS bytes_free FROM INFORMATION_SCHEMA.FILES WHERE FILE_NAME = './myfile.dat';ImportantThe byte values produced by the preceding queries are approximations only, and their precision is inversely proportional to the value of
EXTENT_SIZE. That is, the largerEXTENT_SIZEbecomes, the less accurate the approximations are.It is also important to remember that once an extent is used, it cannot be freed again without dropping the data file of which it is a part. This means that deletes from a Disk Data table do not release disk space.
The extent size can be set in a
CREATE TABLESPACEstatement. For more information, see Section 13.1.21, “CREATE TABLESPACE Statement”.Prior to NDB 8.0.13, an additional row was present in the
FILEStable following the creation of a logfile group, havingNULLin theFILE_NAMEcolumn. In NDB 8.0.13 and later, this row— which did not correspond to any file—is no longer shown, and it is necessary to query thendbinfo.logspacestable to obtain undo log file usage information. See the description of this table as well as Section 23.5.10.1, “NDB Cluster Disk Data Objects”, for more information.The remainder of the discussion in this item applies only to NDB 8.0.12 and earlier. For the row having
NULLin theFILE_NAMEcolumn, the value of theFILE_IDcolumn is always0, that of theFILE_TYPEcolumn is alwaysUNDO LOG, and that of theSTATUScolumn is alwaysNORMAL. The value of theENGINEcolumn is alwaysndbcluster.The
FREE_EXTENTScolumn in this row shows the total number of free extents available to all undo files belonging to a given log file group whose name and number are shown in theLOGFILE_GROUP_NAMEandLOGFILE_GROUP_NUMBERcolumns, respectively.Suppose there are no existing log file groups on your NDB Cluster, and you create one using the following statement:
mysql>
CREATE LOGFILE GROUP lg1ADD UNDOFILE 'undofile.dat'INITIAL_SIZE = 16MUNDO_BUFFER_SIZE = 1MENGINE = NDB;You can now see this
NULLrow when you query theFILEStable:mysql>
SELECT DISTINCTFILE_NAME AS File,FREE_EXTENTS AS Free,TOTAL_EXTENTS AS Total,EXTENT_SIZE AS Size,INITIAL_SIZE AS InitialFROM INFORMATION_SCHEMA.FILES;+--------------+---------+---------+------+----------+ | File | Free | Total | Size | Initial | +--------------+---------+---------+------+----------+ | undofile.dat | NULL | 4194304 | 4 | 16777216 | | NULL | 4184068 | NULL | 4 | NULL | +--------------+---------+---------+------+----------+The total number of free extents available for undo logging is always somewhat less than the sum of the
TOTAL_EXTENTScolumn values for all undo files in the log file group due to overhead required for maintaining the undo files. This can be seen by adding a second undo file to the log file group, then repeating the previous query against theFILEStable:mysql>
ALTER LOGFILE GROUP lg1ADD UNDOFILE 'undofile02.dat'INITIAL_SIZE = 4MENGINE = NDB;mysql>SELECT DISTINCTFILE_NAME AS File,FREE_EXTENTS AS Free,TOTAL_EXTENTS AS Total,EXTENT_SIZE AS Size,INITIAL_SIZE AS InitialFROM INFORMATION_SCHEMA.FILES;+----------------+---------+---------+------+----------+ | File | Free | Total | Size | Initial | +----------------+---------+---------+------+----------+ | undofile.dat | NULL | 4194304 | 4 | 16777216 | | undofile02.dat | NULL | 1048576 | 4 | 4194304 | | NULL | 5223944 | NULL | 4 | NULL | +----------------+---------+---------+------+----------+The amount of free space in bytes which is available for undo logging by Disk Data tables using this log file group can be approximated by multiplying the number of free extents by the initial size:
mysql>
SELECTFREE_EXTENTS AS 'Free Extents',FREE_EXTENTS * EXTENT_SIZE AS 'Free Bytes'FROM INFORMATION_SCHEMA.FILESWHERE LOGFILE_GROUP_NAME = 'lg1'AND FILE_NAME IS NULL;+--------------+------------+ | Free Extents | Free Bytes | +--------------+------------+ | 5223944 | 20895776 | +--------------+------------+If you create an NDB Cluster Disk Data table and then insert some rows into it, you can see approximately how much space remains for undo logging afterward, for example:
mysql>
CREATE TABLESPACE ts1ADD DATAFILE 'data1.dat'USE LOGFILE GROUP lg1INITIAL_SIZE 512MENGINE = NDB;mysql>CREATE TABLE dd (c1 INT NOT NULL PRIMARY KEY,c2 INT,c3 DATE)TABLESPACE ts1 STORAGE DISKENGINE = NDB;mysql>INSERT INTO dd VALUES(NULL, 1234567890, '2007-02-02'),(NULL, 1126789005, '2007-02-03'),(NULL, 1357924680, '2007-02-04'),(NULL, 1642097531, '2007-02-05');mysql>SELECTFREE_EXTENTS AS 'Free Extents',FREE_EXTENTS * EXTENT_SIZE AS 'Free Bytes'FROM INFORMATION_SCHEMA.FILESWHERE LOGFILE_GROUP_NAME = 'lg1'AND FILE_NAME IS NULL;+--------------+------------+ | Free Extents | Free Bytes | +--------------+------------+ | 5207565 | 20830260 | +--------------+------------+Prior to NDB 8.0.13, an additional row was present in the
FILEStable for each NDB Cluster Disk Data tablespace. Because it did not correspond to an actual file, it was removed in NDB 8.0.13. This row hadNULLfor the value of theFILE_NAMEcolumn, the value of theFILE_IDcolumn was always0, that of theFILE_TYPEcolumn was alwaysTABLESPACE, that of theSTATUScolumn was alwaysNORMAL, and the value of theENGINEcolumn is alwaysNDBCLUSTER.In NDB 8.0.13 and later, you can obtain information about Disk Data tablespaces using the ndb_desc utility. For more information, see Section 23.5.10.1, “NDB Cluster Disk Data Objects”, as well as the description of ndb_desc.
For additional information, and examples of creating, dropping, and obtaining information about NDB Cluster Disk Data objects, see Section 23.5.10, “NDB Cluster Disk Data Tables”.
The KEY_COLUMN_USAGE table describes
which key columns have constraints. This table provides no
information about functional key parts because they are
expressions and the table provides information only about columns.
The KEY_COLUMN_USAGE table has these
columns:
CONSTRAINT_CATALOGThe name of the catalog to which the constraint belongs. This value is always
def.CONSTRAINT_SCHEMAThe name of the schema (database) to which the constraint belongs.
CONSTRAINT_NAMEThe name of the constraint.
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table that has the constraint.
COLUMN_NAMEThe name of the column that has the constraint.
If the constraint is a foreign key, then this is the column of the foreign key, not the column that the foreign key references.
ORDINAL_POSITIONThe column's position within the constraint, not the column's position within the table. Column positions are numbered beginning with 1.
POSITION_IN_UNIQUE_CONSTRAINTNULLfor unique and primary-key constraints. For foreign-key constraints, this column is the ordinal position in key of the table that is being referenced.REFERENCED_TABLE_SCHEMAThe name of the schema referenced by the constraint.
REFERENCED_TABLE_NAMEThe name of the table referenced by the constraint.
REFERENCED_COLUMN_NAMEThe name of the column referenced by the constraint.
Suppose that there are two tables name t1 and
t3 that have the following definitions:
CREATE TABLE t1
(
s1 INT,
s2 INT,
s3 INT,
PRIMARY KEY(s3)
) ENGINE=InnoDB;
CREATE TABLE t3
(
s1 INT,
s2 INT,
s3 INT,
KEY(s1),
CONSTRAINT CO FOREIGN KEY (s2) REFERENCES t1(s3)
) ENGINE=InnoDB;
For those two tables, the
KEY_COLUMN_USAGE table has two rows:
One row with
CONSTRAINT_NAME='PRIMARY',TABLE_NAME='t1',COLUMN_NAME='s3',ORDINAL_POSITION=1,POSITION_IN_UNIQUE_CONSTRAINT=NULL.For
NDB: This value is alwaysNULL.One row with
CONSTRAINT_NAME='CO',TABLE_NAME='t3',COLUMN_NAME='s2',ORDINAL_POSITION=1,POSITION_IN_UNIQUE_CONSTRAINT=1.
The ndb_transid_mysql_connection_map table
provides a mapping between NDB transactions,
NDB transaction coordinators, and MySQL Servers
attached to an NDB Cluster as API nodes. This information is used
when populating the
server_operations and
server_transactions tables of
the ndbinfo NDB Cluster
information database.
INFORMATION_SCHEMA Name |
SHOW Name |
Remarks |
|---|---|---|
mysql_connection_id |
MySQL Server connection ID | |
node_id |
Transaction coordinator node ID | |
ndb_transid |
NDB transaction ID |
The mysql_connection_id is the same as the
connection or session ID shown in the output of
SHOW PROCESSLIST.
There are no SHOW statements associated with
this table.
This is a nonstandard table, specific to NDB Cluster. It is
implemented as an INFORMATION_SCHEMA plugin;
you can verify that it is supported by checking the output of
SHOW PLUGINS. If
ndb_transid_mysql_connection_map support is
enabled, the output from this statement includes a plugin having
this name, of type INFORMATION SCHEMA, and
having status ACTIVE, as shown here (using
emphasized text):
mysql> SHOW PLUGINS;
+----------------------------------+--------+--------------------+---------+---------+
| Name | Status | Type | Library | License |
+----------------------------------+--------+--------------------+---------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndbcluster | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndbinfo | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ndb_transid_mysql_connection_map | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
+----------------------------------+--------+--------------------+---------+---------+
22 rows in set (0.00 sec)
The plugin is enabled by default. You can disable it (or force the
server not to run unless the plugin starts) by starting the server
with the
--ndb-transid-mysql-connection-map
option. If the plugin is disabled, the status is shown by
SHOW PLUGINS as
DISABLED. The plugin cannot be enabled or
disabled at runtime.
Although the names of this table and its columns are displayed using lowercase, you can use uppercase or lowercase when referring to them in SQL statements.
For this table to be created, the MySQL Server must be a binary
supplied with the NDB Cluster distribution, or one built from the
NDB Cluster sources with NDB storage
engine support enabled. It is not available in the standard MySQL
8.0 Server.
The KEYWORDS table lists the words
considered keywords by MySQL and, for each one, indicates whether
it is reserved. Reserved keywords may require special treatment in
some contexts, such as special quoting when used as identifiers
(see Section 9.3, “Keywords and Reserved Words”). This table provides applications
a runtime source of MySQL keyword information.
Prior to MySQL 8.0.13, selecting from the
KEYWORDS table with no default database
selected produced an error. (Bug #90160, Bug #27729859)
The KEYWORDS table has these columns:
WORDThe keyword.
RESERVEDAn integer indicating whether the keyword is reserved (1) or nonreserved (0).
These queries lists all keywords, all reserved keywords, and all nonreserved keywords, respectively:
SELECT * FROM INFORMATION_SCHEMA.KEYWORDS; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED = 1; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED = 0;
The latter two queries are equivalent to:
SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE RESERVED; SELECT WORD FROM INFORMATION_SCHEMA.KEYWORDS WHERE NOT RESERVED;
If you build MySQL from source, the build process generates a
keyword_list.h header file containing an
array of keywords and their reserved status. This file can be
found in the sql directory under the build
directory. This file may be useful for applications that require a
static source for the keyword list.
The OPTIMIZER_TRACE table provides
information produced by the optimizer tracing capability for
traced statements. To enable tracking, use the
optimizer_trace system variable.
For details, see
MySQL
Internals: Tracing the Optimizer.
The OPTIMIZER_TRACE table has these
columns:
QUERYThe text of the traced statement.
TRACEThe trace, in
JSONformat.MISSING_BYTES_BEYOND_MAX_MEM_SIZEEach remembered trace is a string that is extended as optimization progresses and appends data to it. The
optimizer_trace_max_mem_sizevariable sets a limit on the total amount of memory used by all currently remembered traces. If this limit is reached, the current trace is not extended (and thus is incomplete), and theMISSING_BYTES_BEYOND_MAX_MEM_SIZEcolumn shows the number of bytes missing from the trace.INSUFFICIENT_PRIVILEGESIf a traced query uses views or stored routines that have
SQL SECURITYwith a value ofDEFINER, it may be that a user other than the definer is denied from seeing the trace of the query. In that case, the trace is shown as empty andINSUFFICIENT_PRIVILEGEShas a value of 1. Otherwise, the value is 0.
The PARAMETERS table provides
information about parameters for stored routines (stored
procedures and stored functions), and about return values for
stored functions. The PARAMETERS
table does not include built-in SQL functions or user-defined
functions (UDFs).
The PARAMETERS table has these
columns:
SPECIFIC_CATALOGThe name of the catalog to which the routine containing the parameter belongs. This value is always
def.SPECIFIC_SCHEMAThe name of the schema (database) to which the routine containing the parameter belongs.
SPECIFIC_NAMEThe name of the routine containing the parameter.
ORDINAL_POSITIONFor successive parameters of a stored procedure or function, the
ORDINAL_POSITIONvalues are 1, 2, 3, and so forth. For a stored function, there is also a row that applies to the function return value (as described by theRETURNSclause). The return value is not a true parameter, so the row that describes it has these unique characteristics:The
ORDINAL_POSITIONvalue is 0.The
PARAMETER_NAMEandPARAMETER_MODEvalues areNULLbecause the return value has no name and the mode does not apply.
PARAMETER_MODEThe mode of the parameter. This value is one of
IN,OUT, orINOUT. For a stored function return value, this value isNULL.PARAMETER_NAMEThe name of the parameter. For a stored function return value, this value is
NULL.DATA_TYPEThe parameter data type.
The
DATA_TYPEvalue is the type name only with no other information. TheDTD_IDENTIFIERvalue contains the type name and possibly other information such as the precision or length.CHARACTER_MAXIMUM_LENGTHFor string parameters, the maximum length in characters.
CHARACTER_OCTET_LENGTHFor string parameters, the maximum length in bytes.
NUMERIC_PRECISIONFor numeric parameters, the numeric precision.
NUMERIC_SCALEFor numeric parameters, the numeric scale.
DATETIME_PRECISIONFor temporal parameters, the fractional seconds precision.
CHARACTER_SET_NAMEFor character string parameters, the character set name.
COLLATION_NAMEFor character string parameters, the collation name.
DTD_IDENTIFIERThe parameter data type.
The
DATA_TYPEvalue is the type name only with no other information. TheDTD_IDENTIFIERvalue contains the type name and possibly other information such as the precision or length.ROUTINE_TYPEPROCEDUREfor stored procedures,FUNCTIONfor stored functions.
The PARTITIONS table provides
information about table partitions. Each row in this table
corresponds to an individual partition or subpartition of a
partitioned table. For more information about partitioning tables,
see Chapter 24, Partitioning.
The PARTITIONS table has these
columns:
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table containing the partition.
PARTITION_NAMEThe name of the partition.
SUBPARTITION_NAMEIf the
PARTITIONStable row represents a subpartition, the name of subpartition; otherwiseNULL.For
NDB: This value is alwaysNULL.PARTITION_ORDINAL_POSITIONAll partitions are indexed in the same order as they are defined, with
1being the number assigned to the first partition. The indexing can change as partitions are added, dropped, and reorganized; the number shown is this column reflects the current order, taking into account any indexing changes.SUBPARTITION_ORDINAL_POSITIONSubpartitions within a given partition are also indexed and reindexed in the same manner as partitions are indexed within a table.
PARTITION_METHODOne of the values
RANGE,LIST,HASH,LINEAR HASH,KEY, orLINEAR KEY; that is, one of the available partitioning types as discussed in Section 24.2, “Partitioning Types”.SUBPARTITION_METHODOne of the values
HASH,LINEAR HASH,KEY, orLINEAR KEY; that is, one of the available subpartitioning types as discussed in Section 24.2.6, “Subpartitioning”.PARTITION_EXPRESSIONThe expression for the partitioning function used in the
CREATE TABLEorALTER TABLEstatement that created the table's current partitioning scheme.For example, consider a partitioned table created in the
testdatabase using this statement:CREATE TABLE tp ( c1 INT, c2 INT, c3 VARCHAR(25) ) PARTITION BY HASH(c1 + c2) PARTITIONS 4;The
PARTITION_EXPRESSIONcolumn in aPARTITIONStable row for a partition from this table displaysc1 + c2, as shown here:mysql>
SELECT DISTINCT PARTITION_EXPRESSIONFROM INFORMATION_SCHEMA.PARTITIONSWHERE TABLE_NAME='tp' AND TABLE_SCHEMA='test';+----------------------+ | PARTITION_EXPRESSION | +----------------------+ | c1 + c2 | +----------------------+SUBPARTITION_EXPRESSIONThis works in the same fashion for the subpartitioning expression that defines the subpartitioning for a table as
PARTITION_EXPRESSIONdoes for the partitioning expression used to define a table's partitioning.If the table has no subpartitions, this column is
NULL.PARTITION_DESCRIPTIONThis column is used for RANGE and LIST partitions. For a
RANGEpartition, it contains the value set in the partition'sVALUES LESS THANclause, which can be either an integer orMAXVALUE. For aLISTpartition, this column contains the values defined in the partition'sVALUES INclause, which is a list of comma-separated integer values.For partitions whose
PARTITION_METHODis other thanRANGEorLIST, this column is alwaysNULL.TABLE_ROWSThe number of table rows in the partition.
For partitioned
InnoDBtables, the row count given in theTABLE_ROWScolumn is only an estimated value used in SQL optimization, and may not always be exact.For
NDBtables, you can also obtain this information using the ndb_desc utility.AVG_ROW_LENGTHThe average length of the rows stored in this partition or subpartition, in bytes. This is the same as
DATA_LENGTHdivided byTABLE_ROWS.For
NDBtables, you can also obtain this information using the ndb_desc utility.DATA_LENGTHThe total length of all rows stored in this partition or subpartition, in bytes; that is, the total number of bytes stored in the partition or subpartition.
For
NDBtables, you can also obtain this information using the ndb_desc utility.MAX_DATA_LENGTHThe maximum number of bytes that can be stored in this partition or subpartition.
For
NDBtables, you can also obtain this information using the ndb_desc utility.INDEX_LENGTHThe length of the index file for this partition or subpartition, in bytes.
For partitions of
NDBtables, whether the tables use implicit or explicit partitioning, theINDEX_LENGTHcolumn value is always 0. However, you can obtain equivalent information using the ndb_desc utility.DATA_FREEThe number of bytes allocated to the partition or subpartition but not used.
For
NDBtables, you can also obtain this information using the ndb_desc utility.CREATE_TIMEThe time that the partition or subpartition was created.
UPDATE_TIMEThe time that the partition or subpartition was last modified.
CHECK_TIMEThe last time that the table to which this partition or subpartition belongs was checked.
For partitioned
InnoDBtables, the value is alwaysNULL.CHECKSUMThe checksum value, if any; otherwise
NULL.PARTITION_COMMENTThe text of the comment, if the partition has one. If not, this value is empty.
The maximum length for a partition comment is defined as 1024 characters, and the display width of the
PARTITION_COMMENTcolumn is also 1024, characters to match this limit.NODEGROUPThis is the nodegroup to which the partition belongs. This is relevant only to NDB Cluster tables; otherwise, the value is always
0.TABLESPACE_NAMEThe name of the tablespace to which the partition belongs. The value is always
DEFAULT, unless the table uses theNDBstorage engine (see the Notes at the end of this section).
Notes
PARTITIONSis a nonstandardINFORMATION_SCHEMAtable.A table using any storage engine other than
NDBand which is not partitioned has one row in thePARTITIONStable. However, the values of thePARTITION_NAME,SUBPARTITION_NAME,PARTITION_ORDINAL_POSITION,SUBPARTITION_ORDINAL_POSITION,PARTITION_METHOD,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION, andPARTITION_DESCRIPTIONcolumns are allNULL. Also, thePARTITION_COMMENTcolumn in this case is blank.An
NDBtable which is not explicitly partitioned has one row in thePARTITIONStable for each data node in the NDB cluster. For each such row:The
SUBPARTITION_NAME,SUBPARTITION_ORDINAL_POSITION,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION,CREATE_TIME,UPDATE_TIME,CHECK_TIME,CHECKSUM, andTABLESPACE_NAMEcolumns are allNULL.The
PARTITION_METHODis alwaysAUTO.The
NODEGROUPcolumn isdefault.The
PARTITION_EXPRESSIONandPARTITION_COMMENTcolumns are empty.
The PLUGINS table provides
information about server plugins.
The PLUGINS table has these columns:
PLUGIN_NAMEThe name used to refer to the plugin in statements such as
INSTALL PLUGINandUNINSTALL PLUGIN.PLUGIN_VERSIONThe version from the plugin's general type descriptor.
PLUGIN_STATUSThe plugin status, one of
ACTIVE,INACTIVE,DISABLED,DELETING, orDELETED.PLUGIN_TYPEThe type of plugin, such as
STORAGE ENGINE,INFORMATION_SCHEMA, orAUTHENTICATION.PLUGIN_TYPE_VERSIONThe version from the plugin's type-specific descriptor.
PLUGIN_LIBRARYThe name of the plugin shared library file. This is the name used to refer to the plugin file in statements such as
INSTALL PLUGINandUNINSTALL PLUGIN. This file is located in the directory named by theplugin_dirsystem variable. If the library name isNULL, the plugin is compiled in and cannot be uninstalled withUNINSTALL PLUGIN.PLUGIN_LIBRARY_VERSIONThe plugin API interface version.
PLUGIN_AUTHORThe plugin author.
PLUGIN_DESCRIPTIONA short description of the plugin.
PLUGIN_LICENSEHow the plugin is licensed (for example,
GPL).LOAD_OPTIONHow the plugin was loaded. The value is
OFF,ON,FORCE, orFORCE_PLUS_PERMANENT. See Section 5.6.1, “Installing and Uninstalling Plugins”.
Notes
PLUGINSis a nonstandardINFORMATION_SCHEMAtable.For plugins installed with
INSTALL PLUGIN, thePLUGIN_NAMEandPLUGIN_LIBRARYvalues are also registered in themysql.plugintable.For information about plugin data structures that form the basis of the information in the
PLUGINStable, see The MySQL Plugin API.
Plugin information is also available from the
SHOW PLUGINS statement. See
Section 13.7.7.25, “SHOW PLUGINS Statement”. These statements are equivalent:
SELECT PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_LIBRARY, PLUGIN_LICENSE FROM INFORMATION_SCHEMA.PLUGINS; SHOW PLUGINS;
The MySQL process list indicates the operations currently being
performed by the set of threads executing within the server. The
PROCESSLIST table is one source of
process information. For a comparison of this table with other
sources, see Sources of Process Information.
The PROCESSLIST table has these
columns:
IDThe connection identifier. This is the same value displayed in the
Idcolumn of theSHOW PROCESSLISTstatement, displayed in thePROCESSLIST_IDcolumn of the Performance Schemathreadstable, and returned by theCONNECTION_ID()function within the thread.USERThe MySQL user who issued the statement. A value of
system userrefers to a nonclient thread spawned by the server to handle tasks internally, for example, a delayed-row handler thread or an I/O or SQL thread used on replica hosts. Forsystem user, there is no host specified in theHostcolumn.unauthenticated userrefers to a thread that has become associated with a client connection but for which authentication of the client user has not yet occurred.event_schedulerrefers to the thread that monitors scheduled events (see Section 25.4, “Using the Event Scheduler”).NoteA
USERvalue ofsystem useris distinct from theSYSTEM_USERprivilege. The former designates internal threads. The latter distinguishes the system user and regular user account categories (see Section 6.2.11, “Account Categories”).HOSTThe host name of the client issuing the statement (except for
system user, for which there is no host). The host name for TCP/IP connections is reported informat to make it easier to determine which client is doing what.host_name:client_portDBThe default database for the thread, or
NULLif none has been selected.COMMANDThe type of command the thread is executing on behalf of the client, or
Sleepif the session is idle. For descriptions of thread commands, see Section 8.14, “Examining Server Thread (Process) Information”. The value of this column corresponds to theCOM_commands of the client/server protocol andxxxCom_status variables. See Section 5.1.10, “Server Status Variables”.xxxTIMEThe time in seconds that the thread has been in its current state. For a replica SQL thread, the value is the number of seconds between the timestamp of the last replicated event and the real time of the replica host. See Section 17.2.3, “Replication Threads”.
STATEAn action, event, or state that indicates what the thread is doing. For descriptions of
STATEvalues, see Section 8.14, “Examining Server Thread (Process) Information”.Most states correspond to very quick operations. If a thread stays in a given state for many seconds, there might be a problem that needs to be investigated.
INFOThe statement the thread is executing, or
NULLif it is executing no statement. The statement might be the one sent to the server, or an innermost statement if the statement executes other statements. For example, if aCALLstatement executes a stored procedure that is executing aSELECTstatement, theINFOvalue shows theSELECTstatement.
Notes
PROCESSLISTis a nonstandardINFORMATION_SCHEMAtable.Like the output from the
SHOW PROCESSLISTstatement, thePROCESSLISTtable provides information about all threads, even those belonging to other users, if you have thePROCESSprivilege. Otherwise (without thePROCESSprivilege), nonanonymous users have access to information about their own threads but not threads for other users, and anonymous users have no access to thread information.If an SQL statement refers to the
PROCESSLISTtable, MySQL populates the entire table once, when statement execution begins, so there is read consistency during the statement. There is no read consistency for a multi-statement transaction.
The following statements are equivalent:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST SHOW FULL PROCESSLIST
The PROFILING table provides
statement profiling information. Its contents correspond to the
information produced by the SHOW
PROFILE and SHOW PROFILES
statements (see Section 13.7.7.30, “SHOW PROFILE Statement”). The table is
empty unless the profiling
session variable is set to 1.
This table is deprecated; expect it to be removed in a future MySQL release. Use the Performance Schema instead; see Section 27.19.1, “Query Profiling Using Performance Schema”.
The PROFILING table has these
columns:
QUERY_IDA numeric statement identifier.
SEQA sequence number indicating the display order for rows with the same
QUERY_IDvalue.STATEThe profiling state to which the row measurements apply.
DURATIONHow long statement execution remained in the given state, in seconds.
CPU_USER,CPU_SYSTEMUser and system CPU use, in seconds.
CONTEXT_VOLUNTARY,CONTEXT_INVOLUNTARYHow many voluntary and involuntary context switches occurred.
BLOCK_OPS_IN,BLOCK_OPS_OUTThe number of block input and output operations.
MESSAGES_SENT,MESSAGES_RECEIVEDThe number of communication messages sent and received.
PAGE_FAULTS_MAJOR,PAGE_FAULTS_MINORThe number of major and minor page faults.
SWAPSHow many swaps occurred.
SOURCE_FUNCTION,SOURCE_FILE, andSOURCE_LINEInformation indicating where in the source code the profiled state executes.
Notes
PROFILINGis a nonstandardINFORMATION_SCHEMAtable.
Profiling information is also available from the
SHOW PROFILE and
SHOW PROFILES statements. See
Section 13.7.7.30, “SHOW PROFILE Statement”. For example, the following queries
are equivalent:
SHOW PROFILE FOR QUERY 2; SELECT STATE, FORMAT(DURATION, 6) AS DURATION FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID = 2 ORDER BY SEQ;
The REFERENTIAL_CONSTRAINTS table
provides information about foreign keys.
The REFERENTIAL_CONSTRAINTS table has
these columns:
CONSTRAINT_CATALOGThe name of the catalog to which the constraint belongs. This value is always
def.CONSTRAINT_SCHEMAThe name of the schema (database) to which the constraint belongs.
CONSTRAINT_NAMEThe name of the constraint.
UNIQUE_CONSTRAINT_CATALOGThe name of the catalog containing the unique constraint that the constraint references. This value is always
def.UNIQUE_CONSTRAINT_SCHEMAThe name of the schema containing the unique constraint that the constraint references.
UNIQUE_CONSTRAINT_NAMEThe name of the unique constraint that the constraint references.
MATCH_OPTIONThe value of the constraint
MATCHattribute. The only valid value at this time isNONE.UPDATE_RULEThe value of the constraint
ON UPDATEattribute. The possible values areCASCADE,SET NULL,SET DEFAULT,RESTRICT,NO ACTION.DELETE_RULEThe value of the constraint
ON DELETEattribute. The possible values areCASCADE,SET NULL,SET DEFAULT,RESTRICT,NO ACTION.TABLE_NAMEThe name of the table. This value is the same as in the
TABLE_CONSTRAINTStable.REFERENCED_TABLE_NAMEThe name of the table referenced by the constraint.
The RESOURCE_GROUPS table provides
access to information about resource groups. For general
discussion of the resource group capability, see
Section 5.1.16, “Resource Groups”.
You can see information only for columns for which you have some privilege.
The RESOURCE_GROUPS table has these
columns:
RESOURCE_GROUP_NAMEThe name of the resource group.
RESOURCE_GROUP_TYPEThe resource group type, either
SYSTEMorUSER.RESOURCE_GROUP_ENABLEDWhether the resource group is enabled (1) or disabled (0);
VCPU_IDSThe CPU affinity; that is, the set of virtual CPUs that the resource group can use. The value is a list of comma-separated CPU numbers or ranges.
THREAD_PRIORITYThe priority for threads assigned to the resource group. The priority ranges from -20 (highest priority) to 19 (lowest priority). System resource groups have a priority that ranges from -20 to 0. User resource groups have a priority that ranges from 0 to 19.
The ROLE_COLUMN_GRANTS table
(available as of MySQL 8.0.19) provides information about the
column privileges for roles that are available to or granted by
the currently enabled roles.
The ROLE_COLUMN_GRANTS table has
these columns:
GRANTORThe user name part of the account that granted the role.
GRANTOR_HOSTThe host name part of the account that granted the role.
GRANTEEThe user name part of the account to which the role is granted.
GRANTEE_HOSTThe host name part of the account to which the role is granted.
TABLE_CATALOGThe name of the catalog to which the role applies. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the role applies.
TABLE_NAMEThe name of the table to which the role applies.
COLUMN_NAMEThe name of the column to which the role applies.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the column level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per column privilege held by the grantee.
IS_GRANTABLEYESorNO, depending on whether the role is grantable to other accounts.
The ROLE_ROUTINE_GRANTS table
(available as of MySQL 8.0.19) provides information about the
routine privileges for roles that are available to or granted by
the currently enabled roles.
The ROLE_ROUTINE_GRANTS table has
these columns:
GRANTORThe user name part of the account that granted the role.
GRANTOR_HOSTThe host name part of the account that granted the role.
GRANTEEThe user name part of the account to which the role is granted.
GRANTEE_HOSTThe host name part of the account to which the role is granted.
SPECIFIC_CATALOGThe name of the catalog to which the routine belongs. This value is always
def.SPECIFIC_SCHEMAThe name of the schema (database) to which the routine belongs.
SPECIFIC_NAMEThe name of the routine.
ROUTINE_CATALOGThe name of the catalog to which the routine belongs. This value is always
def.ROUTINE_SCHEMAThe name of the schema (database) to which the routine belongs.
ROUTINE_NAMEThe name of the routine.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the routine level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per column privilege held by the grantee.
IS_GRANTABLEYESorNO, depending on whether the role is grantable to other accounts.
The ROLE_TABLE_GRANTS table
(available as of MySQL 8.0.19) provides information about the
table privileges for roles that are available to or granted by the
currently enabled roles.
The ROLE_TABLE_GRANTS table has these
columns:
GRANTORThe user name part of the account that granted the role.
GRANTOR_HOSTThe host name part of the account that granted the role.
GRANTEEThe user name part of the account to which the role is granted.
GRANTEE_HOSTThe host name part of the account to which the role is granted.
TABLE_CATALOGThe name of the catalog to which the role applies. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the role applies.
TABLE_NAMEThe name of the table to which the role applies.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the table level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per column privilege held by the grantee.
IS_GRANTABLEYESorNO, depending on whether the role is grantable to other accounts.
The ROUTINES table provides
information about stored routines (stored procedures and stored
functions). The ROUTINES table does
not include built-in SQL functions or user-defined functions
(UDFs).
The ROUTINES table has these columns:
SPECIFIC_NAMEThe name of the routine.
ROUTINE_CATALOGThe name of the catalog to which the routine belongs. This value is always
def.ROUTINE_SCHEMAThe name of the schema (database) to which the routine belongs.
ROUTINE_NAMEThe name of the routine.
ROUTINE_TYPEPROCEDUREfor stored procedures,FUNCTIONfor stored functions.DATA_TYPEIf the routine is a stored function, the return value data type. If the routine is a stored procedure, this value is empty.
The
DATA_TYPEvalue is the type name only with no other information. TheDTD_IDENTIFIERvalue contains the type name and possibly other information such as the precision or length.CHARACTER_MAXIMUM_LENGTHFor stored function string return values, the maximum length in characters. If the routine is a stored procedure, this value is
NULL.CHARACTER_OCTET_LENGTHFor stored function string return values, the maximum length in bytes. If the routine is a stored procedure, this value is
NULL.NUMERIC_PRECISIONFor stored function numeric return values, the numeric precision. If the routine is a stored procedure, this value is
NULL.NUMERIC_SCALEFor stored function numeric return values, the numeric scale. If the routine is a stored procedure, this value is
NULL.DATETIME_PRECISIONFor stored function temporal return values, the fractional seconds precision. If the routine is a stored procedure, this value is
NULL.CHARACTER_SET_NAMEFor stored function character string return values, the character set name. If the routine is a stored procedure, this value is
NULL.COLLATION_NAMEFor stored function character string return values, the collation name. If the routine is a stored procedure, this value is
NULL.DTD_IDENTIFIERIf the routine is a stored function, the return value data type. If the routine is a stored procedure, this value is empty.
The
DATA_TYPEvalue is the type name only with no other information. TheDTD_IDENTIFIERvalue contains the type name and possibly other information such as the precision or length.ROUTINE_BODYThe language used for the routine definition. This value is always
SQL.ROUTINE_DEFINITIONThe text of the SQL statement executed by the routine.
EXTERNAL_NAMEThis value is always
NULL.EXTERNAL_LANGUAGEThe language of the stored routine. The value is read from the
external_languagecolumn of themysql.routinesdata dictionary table.PARAMETER_STYLEThis value is always
SQL.IS_DETERMINISTICYESorNO, depending on whether the routine is defined with theDETERMINISTICcharacteristic.SQL_DATA_ACCESSThe data access characteristic for the routine. The value is one of
CONTAINS SQL,NO SQL,READS SQL DATA, orMODIFIES SQL DATA.SQL_PATHThis value is always
NULL.SECURITY_TYPEThe routine
SQL SECURITYcharacteristic. The value is one ofDEFINERorINVOKER.CREATEDThe date and time when the routine was created. This is a
TIMESTAMPvalue.LAST_ALTEREDThe date and time when the routine was last modified. This is a
TIMESTAMPvalue. If the routine has not been modified since its creation, this value is the same as theCREATEDvalue.SQL_MODEThe SQL mode in effect when the routine was created or altered, and under which the routine executes. For the permitted values, see Section 5.1.11, “Server SQL Modes”.
ROUTINE_COMMENTThe text of the comment, if the routine has one. If not, this value is empty.
DEFINERThe account named in the
DEFINERclause (often the user who created the routine), in'format.user_name'@'host_name'CHARACTER_SET_CLIENTThe session value of the
character_set_clientsystem variable when the routine was created.COLLATION_CONNECTIONThe session value of the
collation_connectionsystem variable when the routine was created.DATABASE_COLLATIONThe collation of the database with which the routine is associated.
Notes
To see information about a routine, you must be the user named as the routine
DEFINER, have theSHOW_ROUTINEprivilege, have theSELECTprivilege at the global level, or have theCREATE ROUTINE,ALTER ROUTINE, orEXECUTEprivilege granted at a scope that includes the routine. TheROUTINE_DEFINITIONcolumn isNULLif you have onlyCREATE ROUTINE,ALTER ROUTINE, orEXECUTE.Information about stored function return values is also available in the
PARAMETERStable. The return value row for a stored function can be identified as the row that has anORDINAL_POSITIONvalue of 0.
A schema is a database, so the
SCHEMATA table provides information
about databases.
The SCHEMATA table has these columns:
CATALOG_NAMEThe name of the catalog to which the schema belongs. This value is always
def.SCHEMA_NAMEThe name of the schema.
DEFAULT_CHARACTER_SET_NAMEThe schema default character set.
DEFAULT_COLLATION_NAMEThe schema default collation.
SQL_PATHThis value is always
NULL.DEFAULT_ENCRYPTIONThe schema default encryption. This column was added in MySQL 8.0.16.
Schema names are also available from the SHOW
DATABASES statement. See
Section 13.7.7.14, “SHOW DATABASES Statement”. The following statements are
equivalent:
SELECT SCHEMA_NAME AS `Database` FROM INFORMATION_SCHEMA.SCHEMATA [WHERE SCHEMA_NAME LIKE 'wild'] SHOW DATABASES [LIKE 'wild']
You see only those databases for which you have some kind of
privilege, unless you have the global SHOW
DATABASES privilege.
Because any static global privilege is considered a privilege
for all databases, any static global privilege enables a user to
see all database names with SHOW
DATABASES or by examining the
SCHEMATA table of
INFORMATION_SCHEMA, except databases that
have been restricted at the database level by partial revokes.
Notes
The
SCHEMATA_EXTENSIONStable augments theSCHEMATAtable with information about schema options.
The SCHEMATA_EXTENSIONS table
(available as of MySQL 8.0.22) augments the
SCHEMATA table with information about
schema options.
The SCHEMATA_EXTENSIONS table has
these columns:
CATALOG_NAMEThe name of the catalog to which the schema belongs. This value is always
def.SCHEMA_NAMEThe name of the schema.
OPTIONSThe options for the schema. If the schema is read only, the value contains
READ ONLY=1. If the schema is not read only, noREAD ONLYoption appears.
Example
mysql>ALTER SCHEMA mydb READ ONLY = 1;mysql>SELECT * FROM INFORMATION_SCHEMA.SCHEMATA_EXTENSIONSWHERE SCHEMA_NAME = 'mydb';+--------------+-------------+-------------+ | CATALOG_NAME | SCHEMA_NAME | OPTIONS | +--------------+-------------+-------------+ | def | mydb | READ ONLY=1 | +--------------+-------------+-------------+ mysql>ALTER SCHEMA mydb READ ONLY = 0;mysql>SELECT * FROM INFORMATION_SCHEMA.SCHEMATA_EXTENSIONSWHERE SCHEMA_NAME = 'mydb';+--------------+-------------+---------+ | CATALOG_NAME | SCHEMA_NAME | OPTIONS | +--------------+-------------+---------+ | def | mydb | | +--------------+-------------+---------+
Notes
SCHEMATA_EXTENSIONSis a nonstandardINFORMATION_SCHEMAtable.
The SCHEMA_PRIVILEGES table provides
information about schema (database) privileges. It takes its
values from the mysql.db system table.
The SCHEMA_PRIVILEGES table has these
columns:
GRANTEEThe name of the account to which the privilege is granted, in
'format.user_name'@'host_name'TABLE_CATALOGThe name of the catalog to which the schema belongs. This value is always
def.TABLE_SCHEMAThe name of the schema.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the schema level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per schema privilege held by the grantee.
IS_GRANTABLEYESif the user has theGRANT OPTIONprivilege,NOotherwise. The output does not listGRANT OPTIONas a separate row withPRIVILEGE_TYPE='GRANT OPTION'.
Notes
SCHEMA_PRIVILEGESis a nonstandardINFORMATION_SCHEMAtable.
The following statements are not equivalent:
SELECT ... FROM INFORMATION_SCHEMA.SCHEMA_PRIVILEGES SHOW GRANTS ...
The STATISTICS table provides
information about table indexes.
Columns in STATISTICS that represent
table statistics hold cached values. The
information_schema_stats_expiry
system variable defines the period of time before cached table
statistics expire. The default is 86400 seconds (24 hours). If
there are no cached statistics or statistics have expired,
statistics are retrieved from storage engines when querying table
statistics columns. To update cached values at any time for a
given table, use ANALYZE TABLE. To
always retrieve the latest statistics directly from storage
engines, set
information_schema_stats_expiry=0.
For more information, see
Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”.
If the innodb_read_only system
variable is enabled, ANALYZE
TABLE may fail because it cannot update statistics
tables in the data dictionary, which use
InnoDB. For ANALYZE
TABLE operations that update the key distribution,
failure may occur even if the operation updates the table itself
(for example, if it is a MyISAM table). To
obtain the updated distribution statistics, set
information_schema_stats_expiry=0.
The STATISTICS table has these
columns:
TABLE_CATALOGThe name of the catalog to which the table containing the index belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table containing the index belongs.
TABLE_NAMEThe name of the table containing the index.
NON_UNIQUE0 if the index cannot contain duplicates, 1 if it can.
INDEX_SCHEMAThe name of the schema (database) to which the index belongs.
INDEX_NAMEThe name of the index. If the index is the primary key, the name is always
PRIMARY.SEQ_IN_INDEXThe column sequence number in the index, starting with 1.
COLUMN_NAMEThe column name. See also the description for the
EXPRESSIONcolumn.COLLATIONHow the column is sorted in the index. This can have values
A(ascending),D(descending), orNULL(not sorted).CARDINALITYAn estimate of the number of unique values in the index. To update this number, run
ANALYZE TABLEor (forMyISAMtables) myisamchk -a.CARDINALITYis counted based on statistics stored as integers, so the value is not necessarily exact even for small tables. The higher the cardinality, the greater the chance that MySQL uses the index when doing joins.SUB_PARTThe index prefix. That is, the number of indexed characters if the column is only partly indexed,
NULLif the entire column is indexed.NotePrefix limits are measured in bytes. However, prefix lengths for index specifications in
CREATE TABLE,ALTER TABLE, andCREATE INDEXstatements are interpreted as number of characters for nonbinary string types (CHAR,VARCHAR,TEXT) and number of bytes for binary string types (BINARY,VARBINARY,BLOB). Take this into account when specifying a prefix length for a nonbinary string column that uses a multibyte character set.For additional information about index prefixes, see Section 8.3.5, “Column Indexes”, and Section 13.1.15, “CREATE INDEX Statement”.
PACKEDIndicates how the key is packed.
NULLif it is not.NULLABLEContains
YESif the column may containNULLvalues and''if not.INDEX_TYPEThe index method used (
BTREE,FULLTEXT,HASH,RTREE).COMMENTInformation about the index not described in its own column, such as
disabledif the index is disabled.INDEX_COMMENTAny comment provided for the index with a
COMMENTattribute when the index was created.IS_VISIBLEWhether the index is visible to the optimizer. See Section 8.3.12, “Invisible Indexes”.
EXPRESSIONMySQL 8.0.13 and higher supports functional key parts (see Functional Key Parts), which affects both the
COLUMN_NAMEandEXPRESSIONcolumns:For a nonfunctional key part,
COLUMN_NAMEindicates the column indexed by the key part andEXPRESSIONisNULL.For a functional key part,
COLUMN_NAMEcolumn isNULLandEXPRESSIONindicates the expression for the key part.
Notes
There is no standard
INFORMATION_SCHEMAtable for indexes. The MySQL column list is similar to what SQL Server 2000 returns forsp_statistics, except thatQUALIFIERandOWNERare replaced withCATALOGandSCHEMA, respectively.
Information about table indexes is also available from the
SHOW INDEX statement. See
Section 13.7.7.22, “SHOW INDEX Statement”. The following statements are
equivalent:
SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'tbl_name' AND table_schema = 'db_name' SHOW INDEX FROMtbl_nameFROMdb_name
The ST_GEOMETRY_COLUMNS table
provides information about table columns that store spatial data.
This table is based on the SQL/MM (ISO/IEC 13249-3) standard, with
extensions as noted. MySQL implements
ST_GEOMETRY_COLUMNS as a view on the
INFORMATION_SCHEMA
COLUMNS table.
The ST_GEOMETRY_COLUMNS table has
these columns:
TABLE_CATALOGThe name of the catalog to which the table containing the column belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table containing the column belongs.
TABLE_NAMEThe name of the table containing the column.
COLUMN_NAMEThe name of the column.
SRS_NAMEThe spatial reference system (SRS) name.
SRS_IDThe spatial reference system ID (SRID).
GEOMETRY_TYPE_NAMEThe column data type. Permitted values are:
geometry,point,linestring,polygon,multipoint,multilinestring,multipolygon,geometrycollection. This column is a MySQL extension to the standard.
The ST_SPATIAL_REFERENCE_SYSTEMS
table provides information about available spatial reference
systems (SRSs) for spatial data. This table is based on the SQL/MM
(ISO/IEC 13249-3) standard.
Entries in the
ST_SPATIAL_REFERENCE_SYSTEMS table
are based on the European Petroleum
Survey Group (EPSG) data set, except for SRID 0, which
corresponds to a special SRS used in MySQL that represents an
infinite flat Cartesian plane with no units assigned to its axes.
For additional information about SRSs, see
Section 11.4.5, “Spatial Reference System Support”.
The ST_SPATIAL_REFERENCE_SYSTEMS
table has these columns:
SRS_NAMEThe spatial reference system name. This value is unique.
SRS_IDThe spatial reference system numeric ID. This value is unique.
SRS_IDvalues represent the same kind of values as the SRID of geometry values or passed as the SRID argument to spatial functions. SRID 0 (the unitless Cartesian plane) is special. It is always a legal spatial reference system ID and can be used in any computations on spatial data that depend on SRID values.ORGANIZATIONThe name of the organization that defined the coordinate system on which the spatial reference system is based.
ORGANIZATION_COORDSYS_IDThe numeric ID given to the spatial reference system by the organization that defined it.
DEFINITIONThe spatial reference system definition.
DEFINITIONvalues are WKT values, represented as specified in the Open Geospatial Consortium document OGC 12-063r5.SRS definition parsing occurs on demand when definitions are needed by GIS functions. Parsed definitions are stored in the data dictionary cache to enable reuse and avoid incurring parsing overhead for every statement that needs SRS information.
DESCRIPTIONThe spatial reference system description.
Notes
The
SRS_NAME,ORGANIZATION,ORGANIZATION_COORDSYS_ID, andDESCRIPTIONcolumns contain information that may be of interest to users, but they are not used by MySQL.
Example
mysql>SELECT * FROM ST_SPATIAL_REFERENCE_SYSTEMSWHERE SRS_ID = 4326\G*************************** 1. row *************************** SRS_NAME: WGS 84 SRS_ID: 4326 ORGANIZATION: EPSG ORGANIZATION_COORDSYS_ID: 4326 DEFINITION: GEOGCS["WGS 84",DATUM["World Geodetic System 1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]], UNIT["degree",0.017453292519943278, AUTHORITY["EPSG","9122"]], AXIS["Lat",NORTH],AXIS["Long",EAST], AUTHORITY["EPSG","4326"]] DESCRIPTION:
This entry describes the SRS used for GPS systems. It has a name
(SRS_NAME) of WGS 84 and an ID
(SRS_ID) of 4326, which is the ID used by the
European Petroleum Survey
Group (EPSG).
The DEFINITION values for projected and
geographic SRSs begin with PROJCS and
GEOGCS, respectively. The definition for SRID 0
is special and has an empty DEFINITION value.
The following query determines how many entries in the
ST_SPATIAL_REFERENCE_SYSTEMS table
correspond to projected, geographic, and other SRSs, based on
DEFINITION values:
mysql>SELECTCOUNT(*),CASE LEFT(DEFINITION, 6)WHEN 'PROJCS' THEN 'Projected'WHEN 'GEOGCS' THEN 'Geographic'ELSE 'Other'END AS SRS_TYPEFROM INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEMSGROUP BY SRS_TYPE;+----------+------------+ | COUNT(*) | SRS_TYPE | +----------+------------+ | 1 | Other | | 4668 | Projected | | 483 | Geographic | +----------+------------+
To enable manipulation of SRS entries stored in the data dictionary, MySQL provides these SQL statements:
CREATE SPATIAL REFERENCE SYSTEM: See Section 13.1.19, “CREATE SPATIAL REFERENCE SYSTEM Statement”. The description for this statement includes additional information about SRS components.DROP SPATIAL REFERENCE SYSTEM: See Section 13.1.31, “DROP SPATIAL REFERENCE SYSTEM Statement”.
The ST_UNITS_OF_MEASURE table
(available as of MySQL 8.0.14) provides information about
acceptable units for the
ST_Distance() function.
The ST_UNITS_OF_MEASURE table has
these columns:
UNIT_NAMEThe name of the unit.
UNIT_TYPEThe unit type (for example,
LINEAR).CONVERSION_FACTORA conversion factor used for internal calculations.
DESCRIPTIONA description of the unit.
The TABLES table provides information
about tables in databases.
Columns in TABLES that represent
table statistics hold cached values. The
information_schema_stats_expiry
system variable defines the period of time before cached table
statistics expire. The default is 86400 seconds (24 hours). If
there are no cached statistics or statistics have expired,
statistics are retrieved from storage engines when querying table
statistics columns. To update cached values at any time for a
given table, use ANALYZE TABLE. To
always retrieve the latest statistics directly from storage
engines, set
information_schema_stats_expiry
to 0. For more information, see
Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”.
If the innodb_read_only system
variable is enabled, ANALYZE
TABLE may fail because it cannot update statistics
tables in the data dictionary, which use
InnoDB. For ANALYZE
TABLE operations that update the key distribution,
failure may occur even if the operation updates the table itself
(for example, if it is a MyISAM table). To
obtain the updated distribution statistics, set
information_schema_stats_expiry=0.
The TABLES table has these columns:
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table.
TABLE_TYPEBASE TABLEfor a table,VIEWfor a view, orSYSTEM VIEWfor anINFORMATION_SCHEMAtable.The
TABLEStable does not listTEMPORARYtables.ENGINEThe storage engine for the table. See Chapter 15, The InnoDB Storage Engine, and Chapter 16, Alternative Storage Engines.
For partitioned tables,
ENGINEshows the name of the storage engine used by all partitions.VERSIONThis column is unused. With the removal of
.frmfiles in MySQL 8.0, this column now reports a hardcoded value of10, which is the last.frmfile version used in MySQL 5.7.ROW_FORMATThe row-storage format (
Fixed,Dynamic,Compressed,Redundant,Compact). ForMyISAMtables,Dynamiccorresponds to what myisamchk -dvv reports asPacked.TABLE_ROWSThe number of rows. Some storage engines, such as
MyISAM, store the exact count. For other storage engines, such asInnoDB, this value is an approximation, and may vary from the actual value by as much as 40% to 50%. In such cases, useSELECT COUNT(*)to obtain an accurate count.TABLE_ROWSisNULLforINFORMATION_SCHEMAtables.For
InnoDBtables, the row count is only a rough estimate used in SQL optimization. (This is also true if theInnoDBtable is partitioned.)AVG_ROW_LENGTHThe average row length.
DATA_LENGTHFor
MyISAM,DATA_LENGTHis the length of the data file, in bytes.For
InnoDB,DATA_LENGTHis the approximate amount of space allocated for the clustered index, in bytes. Specifically, it is the clustered index size, in pages, multiplied by theInnoDBpage size.Refer to the notes at the end of this section for information regarding other storage engines.
MAX_DATA_LENGTHFor
MyISAM,MAX_DATA_LENGTHis maximum length of the data file. This is the total number of bytes of data that can be stored in the table, given the data pointer size used.Unused for
InnoDB.Refer to the notes at the end of this section for information regarding other storage engines.
INDEX_LENGTHFor
MyISAM,INDEX_LENGTHis the length of the index file, in bytes.For
InnoDB,INDEX_LENGTHis the approximate amount of space allocated for non-clustered indexes, in bytes. Specifically, it is the sum of non-clustered index sizes, in pages, multiplied by theInnoDBpage size.Refer to the notes at the end of this section for information regarding other storage engines.
DATA_FREEThe number of allocated but unused bytes.
InnoDBtables report the free space of the tablespace to which the table belongs. For a table located in the shared tablespace, this is the free space of the shared tablespace. If you are using multiple tablespaces and the table has its own tablespace, the free space is for only that table. Free space means the number of bytes in completely free extents minus a safety margin. Even if free space displays as 0, it may be possible to insert rows as long as new extents need not be allocated.For NDB Cluster,
DATA_FREEshows the space allocated on disk for, but not used by, a Disk Data table or fragment on disk. (In-memory data resource usage is reported by theDATA_LENGTHcolumn.)For partitioned tables, this value is only an estimate and may not be absolutely correct. A more accurate method of obtaining this information in such cases is to query the
INFORMATION_SCHEMAPARTITIONStable, as shown in this example:SELECT SUM(DATA_FREE) FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA = 'mydb' AND TABLE_NAME = 'mytable';For more information, see Section 26.21, “The INFORMATION_SCHEMA PARTITIONS Table”.
AUTO_INCREMENTThe next
AUTO_INCREMENTvalue.CREATE_TIMEWhen the table was created.
UPDATE_TIMEWhen the data file was last updated. For some storage engines, this value is
NULL. For example,InnoDBstores multiple tables in its system tablespace and the data file timestamp does not apply. Even with file-per-table mode with eachInnoDBtable in a separate.ibdfile, change buffering can delay the write to the data file, so the file modification time is different from the time of the last insert, update, or delete. ForMyISAM, the data file timestamp is used; however, on Windows the timestamp is not updated by updates, so the value is inaccurate.UPDATE_TIMEdisplays a timestamp value for the lastUPDATE,INSERT, orDELETEperformed onInnoDBtables that are not partitioned. For MVCC, the timestamp value reflects theCOMMITtime, which is considered the last update time. Timestamps are not persisted when the server is restarted or when the table is evicted from theInnoDBdata dictionary cache.CHECK_TIMEWhen the table was last checked. Not all storage engines update this time, in which case, the value is always
NULL.For partitioned
InnoDBtables,CHECK_TIMEis alwaysNULL.TABLE_COLLATIONThe table default collation. The output does not explicitly list the table default character set, but the collation name begins with the character set name.
CHECKSUMThe live checksum value, if any.
CREATE_OPTIONSExtra options used with
CREATE TABLE.CREATE_OPTIONSshowspartitionedfor a partitioned table.Prior to MySQL 8.0.16,
CREATE_OPTIONSshows theENCRYPTIONclause specified for tables created in file-per-table tablespaces. As of MySQL 8.0.16, it shows the encryption clause for file-per-table tablespaces if the table is encrypted or if the specified encryption differs from the schema encryption. The encryption clause is not shown for tables created in general tablespaces. To identify encrypted file-per-table and general tablespaces, query theINNODB_TABLESPACESENCRYPTIONcolumn.When creating a table with strict mode disabled, the storage engine's default row format is used if the specified row format is not supported. The actual row format of the table is reported in the
ROW_FORMATcolumn.CREATE_OPTIONSshows the row format that was specified in theCREATE TABLEstatement.When altering the storage engine of a table, table options that are not applicable to the new storage engine are retained in the table definition to enable reverting the table with its previously defined options to the original storage engine, if necessary. The
CREATE_OPTIONScolumn may show retained options.TABLE_COMMENTThe comment used when creating the table (or information as to why MySQL could not access the table information).
Notes
For
NDBtables, the output of this statement shows appropriate values for theAVG_ROW_LENGTHandDATA_LENGTHcolumns, with the exception thatBLOBcolumns are not taken into account.For
NDBtables,DATA_LENGTHincludes data stored in main memory only; theMAX_DATA_LENGTHandDATA_FREEcolumns apply to Disk Data.For NDB Cluster Disk Data tables,
MAX_DATA_LENGTHshows the space allocated for the disk part of a Disk Data table or fragment. (In-memory data resource usage is reported by theDATA_LENGTHcolumn.)For
MEMORYtables, theDATA_LENGTH,MAX_DATA_LENGTH, andINDEX_LENGTHvalues approximate the actual amount of allocated memory. The allocation algorithm reserves memory in large amounts to reduce the number of allocation operations.For views, most
TABLEScolumns are 0 orNULLexcept thatTABLE_NAMEindicates the view name,CREATE_TIMEindicates the creation time, andTABLE_COMMENTsaysVIEW.
Table information is also available from the
SHOW TABLE STATUS and
SHOW TABLES statements. See
Section 13.7.7.38, “SHOW TABLE STATUS Statement”, and
Section 13.7.7.39, “SHOW TABLES Statement”. The following statements are
equivalent:
SELECT
TABLE_NAME, ENGINE, VERSION, ROW_FORMAT, TABLE_ROWS, AVG_ROW_LENGTH,
DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT,
CREATE_TIME, UPDATE_TIME, CHECK_TIME, TABLE_COLLATION, CHECKSUM,
CREATE_OPTIONS, TABLE_COMMENT
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'db_name'
[AND table_name LIKE 'wild']
SHOW TABLE STATUS
FROM db_name
[LIKE 'wild']
The following statements are equivalent:
SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'db_name' [AND table_name LIKE 'wild'] SHOW FULL TABLES FROMdb_name[LIKE 'wild']
The TABLES_EXTENSIONS table
(available as of MySQL 8.0.21) provides information about table
attributes defined for primary and secondary storage engines.
The TABLES_EXTENSIONS table is
reserved for future use.
The TABLES_EXTENSIONS table has these
columns:
TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table.
ENGINE_ATTRIBUTETable attributes defined for the primary storage engine. Reserved for future use.
SECONDARY_ENGINE_ATTRIBUTETable attributes defined for the secondary storage engine. Reserved for future use.
This table is unused. It is deprecated; expect it to be removed in
a future MySQL release. Other
INFORMATION_SCHEMA tables may provide related
information:
For
NDB, theINFORMATION_SCHEMAFILEStable provides tablespace-related information.For
InnoDB, theINFORMATION_SCHEMAINNODB_TABLESPACESandINNODB_DATAFILEStables provide tablespace metadata.
The TABLESPACES_EXTENSIONS table
(available as of MySQL 8.0.21) provides information about
tablespace attributes defined for primary storage engines.
The TABLESPACES_EXTENSIONS table is
reserved for future use.
The TABLESPACES_EXTENSIONS table has
these columns:
TABLESPACE_NAMEThe name of the tablespace.
ENGINE_ATTRIBUTETablespace attributes defined for the primary storage engine. Reserved for future use.
The TABLE_CONSTRAINTS table describes
which tables have constraints.
The TABLE_CONSTRAINTS table has these
columns:
CONSTRAINT_CATALOGThe name of the catalog to which the constraint belongs. This value is always
def.CONSTRAINT_SCHEMAThe name of the schema (database) to which the constraint belongs.
TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table.
The
CONSTRAINT_TYPEThe type of constraint. The value can be
UNIQUE,PRIMARY KEY,FOREIGN KEY, or (as of MySQL 8.0.16)CHECK. This is aCHAR(notENUM) column.The
UNIQUEandPRIMARY KEYinformation is about the same as what you get from theKey_namecolumn in the output fromSHOW INDEXwhen theNon_uniquecolumn is0.ENFORCEDFor
CHECKconstraints, the value isYESorNOto indicate whether the constraint is enforced. For other constraints, the value is alwaysYES.This column was added in MySQL 8.0.16.
The TABLE_CONSTRAINTS_EXTENSIONS
table (available as of MySQL 8.0.21) provides information about
table constraint attributes defined for primary and secondary
storage engines.
The TABLE_CONSTRAINTS_EXTENSIONS
table is reserved for future use.
The TABLE_CONSTRAINTS_EXTENSIONS
table has these columns:
CONSTRAINT_CATALOGThe name of the catalog to which the table belongs.
CONSTRAINT_SCHEMAThe name of the schema (database) to which the table belongs.
CONSTRAINT_NAMEThe name of the constraint.
TABLE_NAMEThe name of the table.
ENGINE_ATTRIBUTEConstraint attributes defined for the primary storage engine. Reserved for future use.
SECONDARY_ENGINE_ATTRIBUTEConstraint attributes defined for the secondary storage engine. Reserved for future use.
The TABLE_PRIVILEGES table provides
information about table privileges. It takes its values from the
mysql.tables_priv system table.
The TABLE_PRIVILEGES table has these
columns:
GRANTEEThe name of the account to which the privilege is granted, in
'format.user_name'@'host_name'TABLE_CATALOGThe name of the catalog to which the table belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table belongs.
TABLE_NAMEThe name of the table.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the table level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per table privilege held by the grantee.
IS_GRANTABLEYESif the user has theGRANT OPTIONprivilege,NOotherwise. The output does not listGRANT OPTIONas a separate row withPRIVILEGE_TYPE='GRANT OPTION'.
Notes
TABLE_PRIVILEGESis a nonstandardINFORMATION_SCHEMAtable.
The following statements are not equivalent:
SELECT ... FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES SHOW GRANTS ...
The TRIGGERS table provides
information about triggers. To see information about a table's
triggers, you must have the TRIGGER
privilege for the table.
The TRIGGERS table has these columns:
TRIGGER_CATALOGThe name of the catalog to which the trigger belongs. This value is always
def.TRIGGER_SCHEMAThe name of the schema (database) to which the trigger belongs.
TRIGGER_NAMEThe name of the trigger.
EVENT_MANIPULATIONThe trigger event. This is the type of operation on the associated table for which the trigger activates. The value is
INSERT(a row was inserted),DELETE(a row was deleted), orUPDATE(a row was modified).EVENT_OBJECT_CATALOG,EVENT_OBJECT_SCHEMA, andEVENT_OBJECT_TABLEAs noted in Section 25.3, “Using Triggers”, every trigger is associated with exactly one table. These columns indicate the catalog and schema (database) in which this table occurs, and the table name, respectively. The
EVENT_OBJECT_CATALOGvalue is alwaysdef.ACTION_ORDERThe ordinal position of the trigger's action within the list of triggers on the same table with the same
EVENT_MANIPULATIONandACTION_TIMINGvalues.ACTION_CONDITIONThis value is always
NULL.ACTION_STATEMENTThe trigger body; that is, the statement executed when the trigger activates. This text uses UTF-8 encoding.
ACTION_ORIENTATIONThis value is always
ROW.ACTION_TIMINGWhether the trigger activates before or after the triggering event. The value is
BEFOREorAFTER.ACTION_REFERENCE_OLD_TABLEThis value is always
NULL.ACTION_REFERENCE_NEW_TABLEThis value is always
NULL.ACTION_REFERENCE_OLD_ROWandACTION_REFERENCE_NEW_ROWThe old and new column identifiers, respectively. The
ACTION_REFERENCE_OLD_ROWvalue is alwaysOLDand theACTION_REFERENCE_NEW_ROWvalue is alwaysNEW.CREATEDThe date and time when the trigger was created. This is a
TIMESTAMP(2)value (with a fractional part in hundredths of seconds) for triggers.SQL_MODEThe SQL mode in effect when the trigger was created, and under which the trigger executes. For the permitted values, see Section 5.1.11, “Server SQL Modes”.
DEFINERThe account named in the
DEFINERclause (often the user who created the trigger), in'format.user_name'@'host_name'CHARACTER_SET_CLIENTThe session value of the
character_set_clientsystem variable when the trigger was created.COLLATION_CONNECTIONThe session value of the
collation_connectionsystem variable when the trigger was created.DATABASE_COLLATIONThe collation of the database with which the trigger is associated.
Example
The following example uses the ins_sum trigger
defined in Section 25.3, “Using Triggers”:
mysql>SELECT * FROM INFORMATION_SCHEMA.TRIGGERSWHERE TRIGGER_SCHEMA='test' AND TRIGGER_NAME='ins_sum'\G*************************** 1. row *************************** TRIGGER_CATALOG: def TRIGGER_SCHEMA: test TRIGGER_NAME: ins_sum EVENT_MANIPULATION: INSERT EVENT_OBJECT_CATALOG: def EVENT_OBJECT_SCHEMA: test EVENT_OBJECT_TABLE: account ACTION_ORDER: 1 ACTION_CONDITION: NULL ACTION_STATEMENT: SET @sum = @sum + NEW.amount ACTION_ORIENTATION: ROW ACTION_TIMING: BEFORE ACTION_REFERENCE_OLD_TABLE: NULL ACTION_REFERENCE_NEW_TABLE: NULL ACTION_REFERENCE_OLD_ROW: OLD ACTION_REFERENCE_NEW_ROW: NEW CREATED: 2018-08-08 10:10:12.61 SQL_MODE: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES, NO_ZERO_IN_DATE,NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION DEFINER: me@localhost CHARACTER_SET_CLIENT: utf8mb4 COLLATION_CONNECTION: utf8mb4_0900_ai_ci DATABASE_COLLATION: utf8mb4_0900_ai_ci
Trigger information is also available from the
SHOW TRIGGERS statement. See
Section 13.7.7.40, “SHOW TRIGGERS Statement”.
The USER_ATTRIBUTES table (available
as of MySQL 8.0.21) provides information about user comments and
user attributes. It takes its values from the
mysql.user system table.
The USER_ATTRIBUTES table has these
columns:
USERThe user name portion of the account to which the
ATTRIBUTEcolumn value applies.HOSTThe host name portion of the account to which the
ATTRIBUTEcolumn value applies.ATTRIBUTEThe user comment, user attribute, or both belonging to the account specified by the
USERandHOSTcolumns. The value is in JSON object notation. Attributes are shown exactly as set using aCREATE USER ... ATTRIBUTE ...orALTER USER ... ATTRIBUTE ...statement. The user comment is shown as a key-value pair havingcommentas the key.For example, the statement
CREATE USER 'bill'@'localhost' COMMENT 'A comment' ATTRIBUTE '{"foo": "bar", "bazz": "fazz"}'adds the following row to theUSER_ATTRIBUTEStable:+------+-----------+--------------------------------------------------------+ | USER | HOST | ATTRIBUTE | +------+-----------+--------------------------------------------------------+ | bill | localhost | {"foo": "bar", "bazz": "fazz", "comment": "A comment"} | +------+-----------+--------------------------------------------------------+
Notes
USER_ATTRIBUTESis a nonstandardINFORMATION_SCHEMAtable.To obtain only the user comment for a given user as an unquoted string, you can employ a query such as this one:
mysql>
SELECT ATTRIBUTE->>"$.comment" AS Comment->FROM INFORMATION_SCHEMA.USER_ATTRIBUTES->WHERE USER='bill' AND HOST='localhost';+-----------+ | Comment | +-----------+ | A comment | +-----------+Similarly, you can obtain the unquoted value for a given user attribute using its key.
Prior to MySQL 8.0.22,
USER_ATTRIBUTEScontents are accessible by anyone. As of MySQL 8.0.22,USER_ATTRIBUTEScontents are accessible as follows:All rows are accessible if:
The current thread is a replica thread.
The access control system has not been initialized (for example, the server was started with the
--skip-grant-tablesoption).The currently authenticated account has the
UPDATEorSELECTprivilege for themysql.usersystem table.The currently authenticated account has the
CREATE USERandSYSTEM_USERprivileges.
Otherwise, the currently authenticated account can see the row for that account. Additionally, if the account has the
CREATE USERprivilege but not theSYSTEM_USERprivilege, it can see rows for all other accounts that do not have theSYSTEM_USERprivilege.
For more information about specifying account comments and attributes, see Section 13.7.1.3, “CREATE USER Statement”.
The USER_PRIVILEGES table provides
information about global privileges. It takes its values from the
mysql.user system table.
The USER_PRIVILEGES table has these
columns:
GRANTEEThe name of the account to which the privilege is granted, in
'format.user_name'@'host_name'TABLE_CATALOGThe name of the catalog. This value is always
def.PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the global level; see Section 13.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per global privilege held by the grantee.
IS_GRANTABLEYESif the user has theGRANT OPTIONprivilege,NOotherwise. The output does not listGRANT OPTIONas a separate row withPRIVILEGE_TYPE='GRANT OPTION'.
Notes
USER_PRIVILEGESis a nonstandardINFORMATION_SCHEMAtable.
The following statements are not equivalent:
SELECT ... FROM INFORMATION_SCHEMA.USER_PRIVILEGES SHOW GRANTS ...
The VIEWS table provides information
about views in databases. You must have the
SHOW VIEW privilege to access this
table.
The VIEWS table has these columns:
TABLE_CATALOGThe name of the catalog to which the view belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the view belongs.
TABLE_NAMEThe name of the view.
VIEW_DEFINITIONThe
SELECTstatement that provides the definition of the view. This column has most of what you see in theCreate Tablecolumn thatSHOW CREATE VIEWproduces. Skip the words beforeSELECTand skip the wordsWITH CHECK OPTION. Suppose that the original statement was:CREATE VIEW v AS SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1 WITH CHECK OPTION;
Then the view definition looks like this:
SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1
CHECK_OPTIONThe value of the
CHECK_OPTIONattribute. The value is one ofNONE,CASCADE, orLOCAL.IS_UPDATABLEMySQL sets a flag, called the view updatability flag, at
CREATE VIEWtime. The flag is set toYES(true) ifUPDATEandDELETE(and similar operations) are legal for the view. Otherwise, the flag is set toNO(false). TheIS_UPDATABLEcolumn in theVIEWStable displays the status of this flag. It means that the server always knows whether a view is updatable.If a view is not updatable, statements such
UPDATE,DELETE, andINSERTare illegal and are rejected. (Even if a view is updatable, it might not be possible to insert into it; for details, refer to Section 25.5.3, “Updatable and Insertable Views”.)DEFINERThe account of the user who created the view, in
'format.user_name'@'host_name'SECURITY_TYPEThe view
SQL SECURITYcharacteristic. The value is one ofDEFINERorINVOKER.CHARACTER_SET_CLIENTThe session value of the
character_set_clientsystem variable when the view was created.COLLATION_CONNECTIONThe session value of the
collation_connectionsystem variable when the view was created.
Notes
MySQL permits different sql_mode
settings to tell the server the type of SQL syntax to support. For
example, you might use the ANSI
SQL mode to ensure MySQL correctly interprets the standard SQL
concatenation operator, the double bar (||), in
your queries. If you then create a view that concatenates items,
you might worry that changing the
sql_mode setting to a value
different from ANSI could cause
the view to become invalid. But this is not the case. No matter
how you write out a view definition, MySQL always stores it the
same way, in a canonical form. Here is an example that shows how
the server changes a double bar concatenation operator to a
CONCAT() function:
mysql>SET sql_mode = 'ANSI';Query OK, 0 rows affected (0.00 sec) mysql>CREATE VIEW test.v AS SELECT 'a' || 'b' as col1;Query OK, 0 rows affected (0.00 sec) mysql>SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWSWHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v';+----------------------------------+ | VIEW_DEFINITION | +----------------------------------+ | select concat('a','b') AS `col1` | +----------------------------------+ 1 row in set (0.00 sec)
The advantage of storing a view definition in canonical form is
that changes made later to the value of
sql_mode do not affect the
results from the view. However, an additional consequence is that
comments prior to SELECT are
stripped from the definition by the server.
The VIEW_ROUTINE_USAGE table
(available as of MySQL 8.0.13) provides access to information
about stored functions used in view definitions. The table does
not list information about built-in SQL functions or user-defined
functions (UDFs) used in the definitions.
You can see information only for views for which you have some privilege, and only for functions for which you have some privilege.
The VIEW_ROUTINE_USAGE table has
these columns:
TABLE_CATALOGThe name of the catalog to which the view belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the view belongs.
TABLE_NAMEThe name of the view.
SPECIFIC_CATALOGThe name of the catalog to which the function used in the view definition belongs. This value is always
def.SPECIFIC_SCHEMAThe name of the schema (database) to which the function used in the view definition belongs.
SPECIFIC_NAMEThe name of the function used in the view definition.
The VIEW_TABLE_USAGE table (available
as of MySQL 8.0.13) provides access to information about tables
and views used in view definitions.
You can see information only for views for which you have some privilege, and only for tables for which you have some privilege.
The VIEW_TABLE_USAGE table has these
columns:
VIEW_CATALOGThe name of the catalog to which the view belongs. This value is always
def.VIEW_SCHEMAThe name of the schema (database) to which the view belongs.
VIEW_NAMEThe name of the view.
TABLE_CATALOGThe name of the catalog to which the table or view used in the view definition belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table or view used in the view definition belongs.
TABLE_NAMEThe name of the table or view used in the view definition.
- 26.51.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table
- 26.51.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table
- 26.51.3 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table
- 26.51.4 The INFORMATION_SCHEMA INNODB_CACHED_INDEXES Table
- 26.51.5 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables
- 26.51.6 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables
- 26.51.7 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables
- 26.51.8 The INFORMATION_SCHEMA INNODB_COLUMNS Table
- 26.51.9 The INFORMATION_SCHEMA INNODB_DATAFILES Table
- 26.51.10 The INFORMATION_SCHEMA INNODB_FIELDS Table
- 26.51.11 The INFORMATION_SCHEMA INNODB_FOREIGN Table
- 26.51.12 The INFORMATION_SCHEMA INNODB_FOREIGN_COLS Table
- 26.51.13 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table
- 26.51.14 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table
- 26.51.15 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table
- 26.51.16 The INFORMATION_SCHEMA INNODB_FT_DELETED Table
- 26.51.17 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table
- 26.51.18 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table
- 26.51.19 The INFORMATION_SCHEMA INNODB_INDEXES Table
- 26.51.20 The INFORMATION_SCHEMA INNODB_LOCKS Table
- 26.51.21 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table
- 26.51.22 The INFORMATION_SCHEMA INNODB_METRICS Table
- 26.51.23 The INFORMATION_SCHEMA INNODB_SESSION_TEMP_TABLESPACES Table
- 26.51.24 The INFORMATION_SCHEMA INNODB_TABLES Table
- 26.51.25 The INFORMATION_SCHEMA INNODB_TABLESPACES Table
- 26.51.26 The INFORMATION_SCHEMA INNODB_TABLESPACES_BRIEF Table
- 26.51.27 The INFORMATION_SCHEMA INNODB_TABLESTATS View
- 26.51.28 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table
- 26.51.29 The INFORMATION_SCHEMA INNODB_TRX Table
- 26.51.30 The INFORMATION_SCHEMA INNODB_VIRTUAL Table
This section provides table definitions for
InnoDB INFORMATION_SCHEMA
tables. For related information and examples, see
Section 15.15, “InnoDB INFORMATION_SCHEMA Tables”.
InnoDB INFORMATION_SCHEMA
tables can be used to monitor ongoing InnoDB
activity, to detect inefficiencies before they turn into issues, or
to troubleshoot performance and capacity issues. As your database
becomes bigger and busier, running up against the limits of your
hardware capacity, you monitor and tune these aspects to keep the
database running smoothly.
The INNODB_BUFFER_PAGE table provides
information about each page in
the InnoDB
buffer pool.
For related usage information and examples, see Section 15.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
Querying the INNODB_BUFFER_PAGE
table can affect performance. Do not query this table on a
production system unless you are aware of the performance impact
and have determined it to be acceptable. To avoid impacting
performance on a production system, reproduce the issue you want
to investigate and query buffer pool statistics on a test
instance.
The INNODB_BUFFER_PAGE table has
these columns:
POOL_IDThe buffer pool ID. This is an identifier to distinguish between multiple buffer pool instances.
BLOCK_IDThe buffer pool block ID.
SPACEThe tablespace ID; the same value as
INNODB_TABLES.SPACE.PAGE_NUMBERThe page number.
PAGE_TYPEThe page type. The following table shows the permitted values.
Table 26.1 INNODB_BUFFER_PAGE.PAGE_TYPE Values
Page Type Description ALLOCATEDFreshly allocated page BLOBUncompressed BLOB page COMPRESSED_BLOB2Subsequent comp BLOB page COMPRESSED_BLOBFirst compressed BLOB page ENCRYPTED_RTREEEncrypted R-tree EXTENT_DESCRIPTORExtent descriptor page FILE_SPACE_HEADERFile space header FIL_PAGE_TYPE_UNUSEDUnused IBUF_BITMAPInsert buffer bitmap IBUF_FREE_LISTInsert buffer free list IBUF_INDEXInsert buffer index INDEXB-tree node INODEIndex node LOB_DATAUncompressed LOB data LOB_FIRSTFirst page of uncompressed LOB LOB_INDEXUncompressed LOB index PAGE_IO_COMPRESSEDCompressed page PAGE_IO_COMPRESSED_ENCRYPTEDCompressed and encrypted page PAGE_IO_ENCRYPTEDEncrypted page RSEG_ARRAYRollback segment array RTREE_INDEXR-tree index SDI_BLOBUncompressed SDI BLOB SDI_COMPRESSED_BLOBCompressed SDI BLOB SDI_INDEXSDI index SYSTEMSystem page TRX_SYSTEMTransaction system data UNDO_LOGUndo log page UNKNOWNUnknown ZLOB_DATACompressed LOB data ZLOB_FIRSTFirst page of compressed LOB ZLOB_FRAGCompressed LOB fragment ZLOB_FRAG_ENTRYCompressed LOB fragment index ZLOB_INDEXCompressed LOB index FLUSH_TYPEThe flush type.
FIX_COUNTThe number of threads using this block within the buffer pool. When zero, the block is eligible to be evicted.
IS_HASHEDWhether a hash index has been built on this page.
NEWEST_MODIFICATIONThe Log Sequence Number of the youngest modification.
OLDEST_MODIFICATIONThe Log Sequence Number of the oldest modification.
ACCESS_TIMEAn abstract number used to judge the first access time of the page.
TABLE_NAMEThe name of the table the page belongs to. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.INDEX_NAMEThe name of the index the page belongs to. This can be the name of a clustered index or a secondary index. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.NUMBER_RECORDSThe number of records within the page.
DATA_SIZEThe sum of the sizes of the records. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.COMPRESSED_SIZEThe compressed page size.
NULLfor pages that are not compressed.PAGE_STATEThe page state. The following table shows the permitted values.
Table 26.2 INNODB_BUFFER_PAGE.PAGE_STATE Values
Page State Description FILE_PAGEA buffered file page MEMORYContains a main memory object NOT_USEDIn the free list NULLClean compressed pages, compressed pages in the flush list, pages used as buffer pool watch sentinels READY_FOR_USEA free page REMOVE_HASHHash index should be removed before placing in the free list IO_FIXWhether any I/O is pending for this page:
IO_NONE= no pending I/O,IO_READ= read pending,IO_WRITE= write pending.IS_OLDWhether the block is in the sublist of old blocks in the LRU list.
FREE_PAGE_CLOCKThe value of the
freed_page_clockcounter when the block was the last placed at the head of the LRU list. Thefreed_page_clockcounter tracks the number of blocks removed from the end of the LRU list.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE LIMIT 1\G
*************************** 1. row ***************************
POOL_ID: 0
BLOCK_ID: 0
SPACE: 97
PAGE_NUMBER: 2473
PAGE_TYPE: INDEX
FLUSH_TYPE: 1
FIX_COUNT: 0
IS_HASHED: YES
NEWEST_MODIFICATION: 733855581
OLDEST_MODIFICATION: 0
ACCESS_TIME: 3378385672
TABLE_NAME: `employees`.`salaries`
INDEX_NAME: PRIMARY
NUMBER_RECORDS: 468
DATA_SIZE: 14976
COMPRESSED_SIZE: 0
PAGE_STATE: FILE_PAGE
IO_FIX: IO_NONE
IS_OLD: YES
FREE_PAGE_CLOCK: 66
Notes
This table is useful primarily for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.When tables, table rows, partitions, or indexes are deleted, associated pages remain in the buffer pool until space is required for other data. The
INNODB_BUFFER_PAGEtable reports information about these pages until they are evicted from the buffer pool. For more information about how theInnoDBmanages buffer pool data, see Section 15.5.1, “Buffer Pool”.
The INNODB_BUFFER_PAGE_LRU table
provides information about the pages in the
InnoDB buffer
pool; in particular, how they are ordered in the LRU list
that determines which pages to
evict from the buffer pool
when it becomes full.
The INNODB_BUFFER_PAGE_LRU table has
the same columns as the
INNODB_BUFFER_PAGE table, except that
the INNODB_BUFFER_PAGE_LRU table has
LRU_POSITION and COMPRESSED
columns instead of BLOCK_ID and
PAGE_STATE columns.
For related usage information and examples, see Section 15.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
Querying the INNODB_BUFFER_PAGE_LRU
table can affect performance. Do not query this table on a
production system unless you are aware of the performance impact
and have determined it to be acceptable. To avoid impacting
performance on a production system, reproduce the issue you want
to investigate and query buffer pool statistics on a test
instance.
The INNODB_BUFFER_PAGE_LRU table has
these columns:
POOL_IDThe buffer pool ID. This is an identifier to distinguish between multiple buffer pool instances.
LRU_POSITIONThe position of the page in the LRU list.
SPACEThe tablespace ID; the same value as
INNODB_TABLES.SPACE.PAGE_NUMBERThe page number.
PAGE_TYPEThe page type. The following table shows the permitted values.
Table 26.3 INNODB_BUFFER_PAGE_LRU.PAGE_TYPE Values
Page Type Description ALLOCATEDFreshly allocated page BLOBUncompressed BLOB page COMPRESSED_BLOB2Subsequent comp BLOB page COMPRESSED_BLOBFirst compressed BLOB page ENCRYPTED_RTREEEncrypted R-tree EXTENT_DESCRIPTORExtent descriptor page FILE_SPACE_HEADERFile space header FIL_PAGE_TYPE_UNUSEDUnused IBUF_BITMAPInsert buffer bitmap IBUF_FREE_LISTInsert buffer free list IBUF_INDEXInsert buffer index INDEXB-tree node INODEIndex node LOB_DATAUncompressed LOB data LOB_FIRSTFirst page of uncompressed LOB LOB_INDEXUncompressed LOB index PAGE_IO_COMPRESSEDCompressed page PAGE_IO_COMPRESSED_ENCRYPTEDCompressed and encrypted page PAGE_IO_ENCRYPTEDEncrypted page RSEG_ARRAYRollback segment array RTREE_INDEXR-tree index SDI_BLOBUncompressed SDI BLOB SDI_COMPRESSED_BLOBCompressed SDI BLOB SDI_INDEXSDI index SYSTEMSystem page TRX_SYSTEMTransaction system data UNDO_LOGUndo log page UNKNOWNUnknown ZLOB_DATACompressed LOB data ZLOB_FIRSTFirst page of compressed LOB ZLOB_FRAGCompressed LOB fragment ZLOB_FRAG_ENTRYCompressed LOB fragment index ZLOB_INDEXCompressed LOB index FLUSH_TYPEThe flush type.
FIX_COUNTThe number of threads using this block within the buffer pool. When zero, the block is eligible to be evicted.
IS_HASHEDWhether a hash index has been built on this page.
NEWEST_MODIFICATIONThe Log Sequence Number of the youngest modification.
OLDEST_MODIFICATIONThe Log Sequence Number of the oldest modification.
ACCESS_TIMEAn abstract number used to judge the first access time of the page.
TABLE_NAMEThe name of the table the page belongs to. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.INDEX_NAMEThe name of the index the page belongs to. This can be the name of a clustered index or a secondary index. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.NUMBER_RECORDSThe number of records within the page.
DATA_SIZEThe sum of the sizes of the records. This column is applicable only to pages with a
PAGE_TYPEvalue ofINDEX.COMPRESSED_SIZEThe compressed page size.
NULLfor pages that are not compressed.COMPRESSEDWhether the page is compressed.
IO_FIXWhether any I/O is pending for this page:
IO_NONE= no pending I/O,IO_READ= read pending,IO_WRITE= write pending.IS_OLDWhether the block is in the sublist of old blocks in the LRU list.
FREE_PAGE_CLOCKThe value of the
freed_page_clockcounter when the block was the last placed at the head of the LRU list. Thefreed_page_clockcounter tracks the number of blocks removed from the end of the LRU list.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU LIMIT 1\G
*************************** 1. row ***************************
POOL_ID: 0
LRU_POSITION: 0
SPACE: 97
PAGE_NUMBER: 1984
PAGE_TYPE: INDEX
FLUSH_TYPE: 1
FIX_COUNT: 0
IS_HASHED: YES
NEWEST_MODIFICATION: 719490396
OLDEST_MODIFICATION: 0
ACCESS_TIME: 3378383796
TABLE_NAME: `employees`.`salaries`
INDEX_NAME: PRIMARY
NUMBER_RECORDS: 468
DATA_SIZE: 14976
COMPRESSED_SIZE: 0
COMPRESSED: NO
IO_FIX: IO_NONE
IS_OLD: YES
FREE_PAGE_CLOCK: 0
Notes
This table is useful primarily for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.Querying this table can require MySQL to allocate a large block of contiguous memory, more than 64 bytes times the number of active pages in the buffer pool. This allocation could potentially cause an out-of-memory error, especially for systems with multi-gigabyte buffer pools.
Querying this table requires MySQL to lock the data structure representing the buffer pool while traversing the LRU list, which can reduce concurrency, especially for systems with multi-gigabyte buffer pools.
When tables, table rows, partitions, or indexes are deleted, associated pages remain in the buffer pool until space is required for other data. The
INNODB_BUFFER_PAGE_LRUtable reports information about these pages until they are evicted from the buffer pool. For more information about how theInnoDBmanages buffer pool data, see Section 15.5.1, “Buffer Pool”.
The INNODB_BUFFER_POOL_STATS table
provides much of the same buffer pool information provided in
SHOW ENGINE INNODB
STATUS output. Much of the same information may also be
obtained using InnoDB buffer pool
server status
variables.
The idea of making pages in the buffer pool “young” or “not young” refers to transferring them between the sublists at the head and tail of the buffer pool data structure. Pages made “young” take longer to age out of the buffer pool, while pages made “not young” are moved much closer to the point of eviction.
For related usage information and examples, see Section 15.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
The INNODB_BUFFER_POOL_STATS table
has these columns:
POOL_IDThe buffer pool ID. This is an identifier to distinguish between multiple buffer pool instances.
POOL_SIZEThe
InnoDBbuffer pool size in pages.FREE_BUFFERSThe number of free pages in the
InnoDBbuffer pool.DATABASE_PAGESThe number of pages in the
InnoDBbuffer pool containing data. This number includes both dirty and clean pages.OLD_DATABASE_PAGESThe number of pages in the
oldbuffer pool sublist.MODIFIED_DATABASE_PAGESThe number of modified (dirty) database pages.
PENDING_DECOMPRESSThe number of pages pending decompression.
PENDING_READSThe number of pending reads.
PENDING_FLUSH_LRUThe number of pages pending flush in the LRU.
PENDING_FLUSH_LISTThe number of pages pending flush in the flush list.
PAGES_MADE_YOUNGThe number of pages made young.
PAGES_NOT_MADE_YOUNGThe number of pages not made young.
PAGES_MADE_YOUNG_RATEThe number of pages made young per second (pages made young since the last printout / time elapsed).
PAGES_MADE_NOT_YOUNG_RATEThe number of pages not made per second (pages not made young since the last printout / time elapsed).
NUMBER_PAGES_READThe number of pages read.
NUMBER_PAGES_CREATEDThe number of pages created.
NUMBER_PAGES_WRITTENThe number of pages written.
PAGES_READ_RATEThe number of pages read per second (pages read since the last printout / time elapsed).
PAGES_CREATE_RATEThe number of pages created per second (pages created since the last printout / time elapsed).
PAGES_WRITTEN_RATEThe number of pages written per second (pages written since the last printout / time elapsed).
NUMBER_PAGES_GETThe number of logical read requests.
HIT_RATEThe buffer pool hit rate.
YOUNG_MAKE_PER_THOUSAND_GETSThe number of pages made young per thousand gets.
NOT_YOUNG_MAKE_PER_THOUSAND_GETSThe number of pages not made young per thousand gets.
NUMBER_PAGES_READ_AHEADThe number of pages read ahead.
NUMBER_READ_AHEAD_EVICTEDThe number of pages read into the
InnoDBbuffer pool by the read-ahead background thread that were subsequently evicted without having been accessed by queries.READ_AHEAD_RATEThe read-ahead rate per second (pages read ahead since the last printout / time elapsed).
READ_AHEAD_EVICTED_RATEThe number of read-ahead pages evicted without access per second (read-ahead pages not accessed since the last printout / time elapsed).
LRU_IO_TOTALTotal LRU I/O.
LRU_IO_CURRENTLRU I/O for the current interval.
UNCOMPRESS_TOTALThe total number of pages decompressed.
UNCOMPRESS_CURRENTThe number of pages decompressed in the current interval.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS\G
*************************** 1. row ***************************
POOL_ID: 0
POOL_SIZE: 8192
FREE_BUFFERS: 1
DATABASE_PAGES: 8085
OLD_DATABASE_PAGES: 2964
MODIFIED_DATABASE_PAGES: 0
PENDING_DECOMPRESS: 0
PENDING_READS: 0
PENDING_FLUSH_LRU: 0
PENDING_FLUSH_LIST: 0
PAGES_MADE_YOUNG: 22821
PAGES_NOT_MADE_YOUNG: 3544303
PAGES_MADE_YOUNG_RATE: 357.62602199870594
PAGES_MADE_NOT_YOUNG_RATE: 0
NUMBER_PAGES_READ: 2389
NUMBER_PAGES_CREATED: 12385
NUMBER_PAGES_WRITTEN: 13111
PAGES_READ_RATE: 0
PAGES_CREATE_RATE: 0
PAGES_WRITTEN_RATE: 0
NUMBER_PAGES_GET: 33322210
HIT_RATE: 1000
YOUNG_MAKE_PER_THOUSAND_GETS: 18
NOT_YOUNG_MAKE_PER_THOUSAND_GETS: 0
NUMBER_PAGES_READ_AHEAD: 2024
NUMBER_READ_AHEAD_EVICTED: 0
READ_AHEAD_RATE: 0
READ_AHEAD_EVICTED_RATE: 0
LRU_IO_TOTAL: 0
LRU_IO_CURRENT: 0
UNCOMPRESS_TOTAL: 0
UNCOMPRESS_CURRENT: 0
Notes
This table is useful primarily for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_CACHED_INDEXES table
reports the number of index pages cached in the
InnoDB buffer pool for each index.
For related usage information and examples, see Section 15.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”.
The INNODB_CACHED_INDEXES table has
these columns:
SPACE_IDThe tablespace ID.
INDEX_IDAn identifier for the index. Index identifiers are unique across all the databases in an instance.
N_CACHED_PAGESThe number of index pages cached in the
InnoDBbuffer pool.
Examples
This query returns the number of index pages cached in the
InnoDB buffer pool for a specific index:
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CACHED_INDEXES WHERE INDEX_ID=65\G
*************************** 1. row ***************************
SPACE_ID: 4294967294
INDEX_ID: 65
N_CACHED_PAGES: 45
This query returns the number of index pages cached in the
InnoDB buffer pool for each index, using the
INNODB_INDEXES and
INNODB_TABLES tables to resolve the
table name and index name for each INDEX_ID
value.
SELECT tables.NAME AS table_name, indexes.NAME AS index_name, cached.N_CACHED_PAGES AS n_cached_pages FROM INFORMATION_SCHEMA.INNODB_CACHED_INDEXES AS cached, INFORMATION_SCHEMA.INNODB_INDEXES AS indexes, INFORMATION_SCHEMA.INNODB_TABLES AS tables WHERE cached.INDEX_ID = indexes.INDEX_ID AND indexes.TABLE_ID = tables.TABLE_ID;
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_CMP and
INNODB_CMP_RESET tables provide
status information on operations related to
compressed
InnoDB tables.
The INNODB_CMP and
INNODB_CMP_RESET tables have these
columns:
PAGE_SIZEThe compressed page size in bytes.
COMPRESS_OPSThe number of times a B-tree page of size
PAGE_SIZEhas been compressed. Pages are compressed whenever an empty page is created or the space for the uncompressed modification log runs out.COMPRESS_OPS_OKThe number of times a B-tree page of size
PAGE_SIZEhas been successfully compressed. This count should never exceedCOMPRESS_OPS.COMPRESS_TIMEThe total time in seconds used for attempts to compress B-tree pages of size
PAGE_SIZE.UNCOMPRESS_OPSThe number of times a B-tree page of size
PAGE_SIZEhas been uncompressed. B-tree pages are uncompressed whenever compression fails or at first access when the uncompressed page does not exist in the buffer pool.UNCOMPRESS_TIMEThe total time in seconds used for uncompressing B-tree pages of the size
PAGE_SIZE.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP\G
*************************** 1. row ***************************
page_size: 1024
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 2. row ***************************
page_size: 2048
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 3. row ***************************
page_size: 4096
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
*************************** 4. row ***************************
page_size: 8192
compress_ops: 86955
compress_ops_ok: 81182
compress_time: 27
uncompress_ops: 26828
uncompress_time: 5
*************************** 5. row ***************************
page_size: 16384
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 0
uncompress_time: 0
Notes
Use these tables to measure the effectiveness of
InnoDBtable compression in your database.You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For usage information, see Section 15.9.1.4, “Monitoring InnoDB Table Compression at Runtime” and Section 15.15.1.3, “Using the Compression Information Schema Tables”. For general information about
InnoDBtable compression, see Section 15.9, “InnoDB Table and Page Compression”.
The INNODB_CMPMEM and
INNODB_CMPMEM_RESET tables provide
status information on compressed
pages within the
InnoDB buffer
pool.
The INNODB_CMPMEM and
INNODB_CMPMEM_RESET tables have these
columns:
PAGE_SIZEThe block size in bytes. Each record of this table describes blocks of this size.
BUFFER_POOL_INSTANCEA unique identifier for the buffer pool instance.
PAGES_USEDThe number of blocks of size
PAGE_SIZEthat are currently in use.PAGES_FREEThe number of blocks of size
PAGE_SIZEthat are currently available for allocation. This column shows the external fragmentation in the memory pool. Ideally, these numbers should be at most 1.RELOCATION_OPSThe number of times a block of size
PAGE_SIZEhas been relocated. The buddy system can relocate the allocated “buddy neighbor” of a freed block when it tries to form a bigger freed block. Reading from theINNODB_CMPMEM_RESETtable resets this count.RELOCATION_TIMEThe total time in microseconds used for relocating blocks of size
PAGE_SIZE. Reading from the tableINNODB_CMPMEM_RESETresets this count.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM\G
*************************** 1. row ***************************
page_size: 1024
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 2. row ***************************
page_size: 2048
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 3. row ***************************
page_size: 4096
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
*************************** 4. row ***************************
page_size: 8192
buffer_pool_instance: 0
pages_used: 7673
pages_free: 15
relocation_ops: 4638
relocation_time: 0
*************************** 5. row ***************************
page_size: 16384
buffer_pool_instance: 0
pages_used: 0
pages_free: 0
relocation_ops: 0
relocation_time: 0
Notes
Use these tables to measure the effectiveness of
InnoDBtable compression in your database.You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For usage information, see Section 15.9.1.4, “Monitoring InnoDB Table Compression at Runtime” and Section 15.15.1.3, “Using the Compression Information Schema Tables”. For general information about
InnoDBtable compression, see Section 15.9, “InnoDB Table and Page Compression”.
The INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET tables
provide status information on operations related to
compressed
InnoDB tables and indexes, with separate
statistics for each combination of database, table, and index, to
help you evaluate the performance and usefulness of compression
for specific tables.
For a compressed InnoDB table, both the table
data and all the secondary
indexes are compressed. In this context, the table data is
treated as just another index, one that happens to contain all the
columns: the clustered
index.
The INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET tables
have these columns:
DATABASE_NAMEThe schema (database) containing the applicable table.
TABLE_NAMEThe table to monitor for compression statistics.
INDEX_NAMEThe index to monitor for compression statistics.
COMPRESS_OPSThe number of compression operations attempted. Pages are compressed whenever an empty page is created or the space for the uncompressed modification log runs out.
COMPRESS_OPS_OKThe number of successful compression operations. Subtract from the
COMPRESS_OPSvalue to get the number of compression failures. Divide by theCOMPRESS_OPSvalue to get the percentage of compression failures.COMPRESS_TIMEThe total time in seconds used for compressing data in this index.
UNCOMPRESS_OPSThe number of uncompression operations performed. Compressed
InnoDBpages are uncompressed whenever compression fails, or the first time a compressed page is accessed in the buffer pool and the uncompressed page does not exist.UNCOMPRESS_TIMEThe total time in seconds used for uncompressing data in this index.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX\G
*************************** 1. row ***************************
database_name: employees
table_name: salaries
index_name: PRIMARY
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 23451
uncompress_time: 4
*************************** 2. row ***************************
database_name: employees
table_name: salaries
index_name: emp_no
compress_ops: 0
compress_ops_ok: 0
compress_time: 0
uncompress_ops: 1597
uncompress_time: 0
Notes
Use these tables to measure the effectiveness of
InnoDBtable compression for specific tables, indexes, or both.You must have the
PROCESSprivilege to query these tables.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of these tables, including data types and default values.Because collecting separate measurements for every index imposes substantial performance overhead,
INNODB_CMP_PER_INDEXandINNODB_CMP_PER_INDEX_RESETstatistics are not gathered by default. You must enable theinnodb_cmp_per_index_enabledsystem variable before performing the operations on compressed tables that you want to monitor.For usage information, see Section 15.9.1.4, “Monitoring InnoDB Table Compression at Runtime” and Section 15.15.1.3, “Using the Compression Information Schema Tables”. For general information about
InnoDBtable compression, see Section 15.9, “InnoDB Table and Page Compression”.
The INNODB_COLUMNS table provides
metadata about InnoDB table columns.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_COLUMNS table has these
columns:
TABLE_IDAn identifier representing the table associated with the column; the same value as
INNODB_TABLES.TABLE_ID.NAMEThe name of the column. These names can be uppercase or lowercase depending on the
lower_case_table_namessetting. There are no special system-reserved names for columns.POSThe ordinal position of the column within the table, starting from 0 and incrementing sequentially. When a column is dropped, the remaining columns are reordered so that the sequence has no gaps. The
POSvalue for a virtual generated column encodes the column sequence number and ordinal position of the column. For more information, see thePOScolumn description in Section 26.51.30, “The INFORMATION_SCHEMA INNODB_VIRTUAL Table”.MTYPEStands for “main type”. A numeric identifier for the column type. 1 =
VARCHAR, 2 =CHAR, 3 =FIXBINARY, 4 =BINARY, 5 =BLOB, 6 =INT, 7 =SYS_CHILD, 8 =SYS, 9 =FLOAT, 10 =DOUBLE, 11 =DECIMAL, 12 =VARMYSQL, 13 =MYSQL, 14 =GEOMETRY.PRTYPEThe
InnoDB“precise type”, a binary value with bits representing MySQL data type, character set code, and nullability.LENThe column length, for example 4 for
INTand 8 forBIGINT. For character columns in multibyte character sets, this length value is the maximum length in bytes needed to represent a definition such asVARCHAR(; that is, it might beN)2*,N3*, and so on depending on the character encoding.NHAS_DEFAULTA boolean value indicating whether a column that was added instantly using
ALTER TABLE ... ADD COLUMNwithALGORITHM=INSTANThas a default value. All columns added instantly have a default value, which makes this column an indicator of whether the column was added instantly.DEFAULT_VALUEThe initial default value of a column that was added instantly using
ALTER TABLE ... ADD COLUMNwithALGORITHM=INSTANT. If the default value isNULLor was not specified, this column reportsNULL. An explicitly specified non-NULLdefault value is shown in an internal binary format. Subsequent modifications of the column default value do not change the value reported by this column.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_COLUMNS where TABLE_ID = 71\G
*************************** 1. row ***************************
TABLE_ID: 71
NAME: col1
POS: 0
MTYPE: 6
PRTYPE: 1027
LEN: 4
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
*************************** 2. row ***************************
TABLE_ID: 71
NAME: col2
POS: 1
MTYPE: 2
PRTYPE: 524542
LEN: 10
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
*************************** 3. row ***************************
TABLE_ID: 71
NAME: col3
POS: 2
MTYPE: 1
PRTYPE: 524303
LEN: 10
HAS_DEFAULT: 0
DEFAULT_VALUE: NULL
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_DATAFILES table provides
data file path information for InnoDB
file-per-table and general tablespaces.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INFORMATION_SCHEMA
FILES table reports metadata for
InnoDB tablespace types including
file-per-table tablespaces, general tablespaces, the system
tablespace, the global temporary tablespace, and undo
tablespaces.
The INNODB_DATAFILES table has these
columns:
SPACEThe tablespace ID.
PATHThe tablespace data file path. If a file-per-table tablespace is created in a location outside the MySQL data directory, the path value is a fully qualified directory path. Otherwise, the path is relative to the data directory.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_DATAFILES WHERE SPACE = 57\G
*************************** 1. row ***************************
SPACE: 57
PATH: ./test/t1.ibd
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_FIELDS table provides
metadata about the key columns (fields) of
InnoDB indexes.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_FIELDS table has these
columns:
INDEX_IDAn identifier for the index associated with this key field; the same value as
INNODB_INDEXES.INDEX_ID.NAMEThe name of the original column from the table; the same value as
INNODB_COLUMNS.NAME.POSThe ordinal position of the key field within the index, starting from 0 and incrementing sequentially. When a column is dropped, the remaining columns are reordered so that the sequence has no gaps.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FIELDS WHERE INDEX_ID = 117\G
*************************** 1. row ***************************
INDEX_ID: 117
NAME: col1
POS: 0
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_FOREIGN table provides
metadata about InnoDB
foreign keys.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_FOREIGN table has these
columns:
IDThe name (not a numeric value) of the foreign key index, preceded by the schema (database) name (for example,
test/products_fk).FOR_NAMEThe name of the child table in this foreign key relationship.
REF_NAMEThe name of the parent table in this foreign key relationship.
N_COLSThe number of columns in the foreign key index.
TYPEA collection of bit flags with information about the foreign key column, ORed together. 0 =
ON DELETE/UPDATE RESTRICT, 1 =ON DELETE CASCADE, 2 =ON DELETE SET NULL, 4 =ON UPDATE CASCADE, 8 =ON UPDATE SET NULL, 16 =ON DELETE NO ACTION, 32 =ON UPDATE NO ACTION.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FOREIGN\G
*************************** 1. row ***************************
ID: test/fk1
FOR_NAME: test/child
REF_NAME: test/parent
N_COLS: 1
TYPE: 1
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_FOREIGN_COLS table
provides status information about InnoDB
foreign key columns.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_FOREIGN_COLS table has
these columns:
IDThe foreign key index associated with this index key field; the same value as
INNODB_FOREIGN.ID.FOR_COL_NAMEThe name of the associated column in the child table.
REF_COL_NAMEThe name of the associated column in the parent table.
POSThe ordinal position of this key field within the foreign key index, starting from 0.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FOREIGN_COLS WHERE ID = 'test/fk1'\G
*************************** 1. row ***************************
ID: test/fk1
FOR_COL_NAME: parent_id
REF_COL_NAME: id
POS: 0
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_FT_BEING_DELETED table
provides a snapshot of the
INNODB_FT_DELETED table; it is used
only during an OPTIMIZE TABLE
maintenance operation. When OPTIMIZE
TABLE is run, the
INNODB_FT_BEING_DELETED table is
emptied, and DOC_ID values are removed from the
INNODB_FT_DELETED table. Because the
contents of INNODB_FT_BEING_DELETED
typically have a short lifetime, this table has limited utility
for monitoring or debugging. For information about running
OPTIMIZE TABLE on tables with
FULLTEXT indexes, see
Section 12.10.6, “Fine-Tuning MySQL Full-Text Search”.
This table is empty initially. Before querying it, set the value
of the innodb_ft_aux_table system
variable to the name (including the database name) of the table
that contains the FULLTEXT index (for example,
test/articles). The output appears similar to
the example provided for the
INNODB_FT_DELETED table.
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_BEING_DELETED table has
these columns:
DOC_IDThe document ID of the row that is in the process of being deleted. This value might reflect the value of an ID column that you defined for the underlying table, or it can be a sequence value generated by
InnoDBwhen the table contains no suitable column. This value is used when you perform text searches, to skip rows in theINNODB_FT_INDEX_TABLEtable before data for deleted rows is physically removed from theFULLTEXTindex by anOPTIMIZE TABLEstatement. For more information, see Optimizing InnoDB Full-Text Indexes.
Notes
Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.You must have the
PROCESSprivilege to query this table.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_FT_CONFIG table provides
metadata about the FULLTEXT index and
associated processing for an InnoDB table.
This table is empty initially. Before querying it, set the value
of the innodb_ft_aux_table system
variable to the name (including the database name) of the table
that contains the FULLTEXT index (for example,
test/articles).
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_CONFIG table has these
columns:
KEYThe name designating an item of metadata for an
InnoDBtable containing aFULLTEXTindex.The values for this column might change, depending on the needs for performance tuning and debugging for
InnoDBfull-text processing. The key names and their meanings include:optimize_checkpoint_limit: The number of seconds after which anOPTIMIZE TABLErun stops.synced_doc_id: The nextDOC_IDto be issued.stopword_table_name: Thedatabase/tablename for a user-defined stopword table. TheVALUEcolumn is empty if there is no user-defined stopword table.use_stopword: Indicates whether a stopword table is used, which is defined when theFULLTEXTindex is created.
VALUEThe value associated with the corresponding
KEYcolumn, reflecting some limit or current value for an aspect of aFULLTEXTindex for anInnoDBtable.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
+---------------------------+-------------------+
| KEY | VALUE |
+---------------------------+-------------------+
| optimize_checkpoint_limit | 180 |
| synced_doc_id | 0 |
| stopword_table_name | test/my_stopwords |
| use_stopword | 1 |
+---------------------------+-------------------+
Notes
This table is intended only for internal configuration. It is not intended for statistical information purposes.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_FT_DEFAULT_STOPWORD table
holds a list of stopwords
that are used by default when creating a
FULLTEXT index on InnoDB
tables. For information about the default
InnoDB stopword list and how to define your own
stopword lists, see Section 12.10.4, “Full-Text Stopwords”.
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_DEFAULT_STOPWORD table
has these columns:
valueA word that is used by default as a stopword for
FULLTEXTindexes onInnoDBtables. This is not used if you override the default stopword processing with either theinnodb_ft_server_stopword_tableor theinnodb_ft_user_stopword_tablesystem variable.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;
+-------+
| value |
+-------+
| a |
| about |
| an |
| are |
| as |
| at |
| be |
| by |
| com |
| de |
| en |
| for |
| from |
| how |
| i |
| in |
| is |
| it |
| la |
| of |
| on |
| or |
| that |
| the |
| this |
| to |
| was |
| what |
| when |
| where |
| who |
| will |
| with |
| und |
| the |
| www |
+-------+
36 rows in set (0.00 sec)
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_FT_DELETED table stores
rows that are deleted from the FULLTEXT index
for an InnoDB table. To avoid expensive index
reorganization during DML operations for an
InnoDB FULLTEXT index, the
information about newly deleted words is stored separately,
filtered out of search results when you do a text search, and
removed from the main search index only when you issue an
OPTIMIZE TABLE statement for the
InnoDB table. For more information, see
Optimizing InnoDB Full-Text Indexes.
This table is empty initially. Before querying it, set the value
of the innodb_ft_aux_table system
variable to the name (including the database name) of the table
that contains the FULLTEXT index (for example,
test/articles).
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_DELETED table has these
columns:
DOC_IDThe document ID of the newly deleted row. This value might reflect the value of an ID column that you defined for the underlying table, or it can be a sequence value generated by
InnoDBwhen the table contains no suitable column. This value is used when you perform text searches, to skip rows in theINNODB_FT_INDEX_TABLEtable before data for deleted rows is physically removed from theFULLTEXTindex by anOPTIMIZE TABLEstatement. For more information, see Optimizing InnoDB Full-Text Indexes.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
+--------+
| DOC_ID |
+--------+
| 6 |
| 7 |
| 8 |
+--------+
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_FT_INDEX_CACHE table
provides token information about newly inserted rows in a
FULLTEXT index. To avoid expensive index
reorganization during DML operations, the information about newly
indexed words is stored separately, and combined with the main
search index only when OPTIMIZE
TABLE is run, when the server is shut down, or when the
cache size exceeds a limit defined by the
innodb_ft_cache_size or
innodb_ft_total_cache_size system
variable.
This table is empty initially. Before querying it, set the value
of the innodb_ft_aux_table system
variable to the name (including the database name) of the table
that contains the FULLTEXT index (for example,
test/articles).
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_INDEX_CACHE table has
these columns:
WORDA word extracted from the text of a newly inserted row.
FIRST_DOC_IDThe first document ID in which this word appears in the
FULLTEXTindex.LAST_DOC_IDThe last document ID in which this word appears in the
FULLTEXTindex.DOC_COUNTThe number of rows in which this word appears in the
FULLTEXTindex. The same word can occur several times within the cache table, once for each combination ofDOC_IDandPOSITIONvalues.DOC_IDThe document ID of the newly inserted row. This value might reflect the value of an ID column that you defined for the underlying table, or it can be a sequence value generated by
InnoDBwhen the table contains no suitable column.POSITIONThe position of this particular instance of the word within the relevant document identified by the
DOC_IDvalue. The value does not represent an absolute position; it is an offset added to thePOSITIONof the previous instance of that word.
Notes
This table is empty initially. Before querying it, set the value of the
innodb_ft_aux_tablesystem variable to the name (including the database name) of the table that contains theFULLTEXTindex (for exampletest/articles). The following example demonstrates how to use theinnodb_ft_aux_tablesystem variable to show information about aFULLTEXTindex for a specified table.mysql>
USE test;mysql>CREATE TABLE articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,title VARCHAR(200),body TEXT,FULLTEXT (title,body)) ENGINE=InnoDB;mysql>INSERT INTO articles (title,body) VALUES('MySQL Tutorial','DBMS stands for DataBase ...'),('How To Use MySQL Well','After you went through a ...'),('Optimizing MySQL','In this tutorial we show ...'),('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),('MySQL vs. YourSQL','In the following database comparison ...'),('MySQL Security','When configured properly, MySQL ...');mysql>SET GLOBAL innodb_ft_aux_table = 'test/articles';mysql>SELECT WORD, DOC_COUNT, DOC_ID, POSITIONFROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE LIMIT 5;+------------+-----------+--------+----------+ | WORD | DOC_COUNT | DOC_ID | POSITION | +------------+-----------+--------+----------+ | 1001 | 1 | 4 | 0 | | after | 1 | 2 | 22 | | comparison | 1 | 5 | 44 | | configured | 1 | 6 | 20 | | database | 2 | 1 | 31 | +------------+-----------+--------+----------+You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_FT_INDEX_TABLE table
provides information about the inverted index used to process text
searches against the FULLTEXT index of an
InnoDB table.
This table is empty initially. Before querying it, set the value
of the innodb_ft_aux_table system
variable to the name (including the database name) of the table
that contains the FULLTEXT index (for example,
test/articles).
For related usage information and examples, see Section 15.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”.
The INNODB_FT_INDEX_TABLE table has
these columns:
WORDA word extracted from the text of the columns that are part of a
FULLTEXT.FIRST_DOC_IDThe first document ID in which this word appears in the
FULLTEXTindex.LAST_DOC_IDThe last document ID in which this word appears in the
FULLTEXTindex.DOC_COUNTThe number of rows in which this word appears in the
FULLTEXTindex. The same word can occur several times within the cache table, once for each combination ofDOC_IDandPOSITIONvalues.DOC_IDThe document ID of the row containing the word. This value might reflect the value of an ID column that you defined for the underlying table, or it can be a sequence value generated by
InnoDBwhen the table contains no suitable column.POSITIONThe position of this particular instance of the word within the relevant document identified by the
DOC_IDvalue.
Notes
This table is empty initially. Before querying it, set the value of the
innodb_ft_aux_tablesystem variable to the name (including the database name) of the table that contains theFULLTEXTindex (for example,test/articles). The following example demonstrates how to use theinnodb_ft_aux_tablesystem variable to show information about aFULLTEXTindex for a specified table. Before information for newly inserted rows appears inINNODB_FT_INDEX_TABLE, theFULLTEXTindex cache must be flushed to disk. This is accomplished by running anOPTIMIZE TABLEoperation on the indexed table with theinnodb_optimize_fulltext_onlysystem variable enabled. (The example disables that variable again at the end because it is intended to be enabled only temporarily.)mysql>
USE test;mysql>CREATE TABLE articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,title VARCHAR(200),body TEXT,FULLTEXT (title,body)) ENGINE=InnoDB;mysql>INSERT INTO articles (title,body) VALUES('MySQL Tutorial','DBMS stands for DataBase ...'),('How To Use MySQL Well','After you went through a ...'),('Optimizing MySQL','In this tutorial we show ...'),('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),('MySQL vs. YourSQL','In the following database comparison ...'),('MySQL Security','When configured properly, MySQL ...');mysql>SET GLOBAL innodb_optimize_fulltext_only=ON;mysql>OPTIMIZE TABLE articles;+---------------+----------+----------+----------+ | Table | Op | Msg_type | Msg_text | +---------------+----------+----------+----------+ | test.articles | optimize | status | OK | +---------------+----------+----------+----------+ mysql>SET GLOBAL innodb_ft_aux_table = 'test/articles';mysql>SELECT WORD, DOC_COUNT, DOC_ID, POSITIONFROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE LIMIT 5;+------------+-----------+--------+----------+ | WORD | DOC_COUNT | DOC_ID | POSITION | +------------+-----------+--------+----------+ | 1001 | 1 | 4 | 0 | | after | 1 | 2 | 22 | | comparison | 1 | 5 | 44 | | configured | 1 | 6 | 20 | | database | 2 | 1 | 31 | +------------+-----------+--------+----------+ mysql>SET GLOBAL innodb_optimize_fulltext_only=OFF;You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.For more information about
InnoDBFULLTEXTsearch, see Section 15.6.2.4, “InnoDB FULLTEXT Indexes”, and Section 12.10, “Full-Text Search Functions”.
The INNODB_INDEXES table provides
metadata about InnoDB indexes.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_INDEXES table has these
columns:
INDEX_IDAn identifier for the index. Index identifiers are unique across all the databases in an instance.
NAMEThe name of the index. Most indexes created implicitly by
InnoDBhave consistent names but the index names are not necessarily unique. Examples:PRIMARYfor a primary key index,GEN_CLUST_INDEXfor the index representing a primary key when one is not specified, andID_IND,FOR_IND, andREF_INDfor foreign key constraints.TABLE_IDAn identifier representing the table associated with the index; the same value as
INNODB_TABLES.TABLE_ID.TYPEA numeric value derived from bit-level information that identifies the index type. 0 = nonunique secondary index; 1 = automatically generated clustered index (
GEN_CLUST_INDEX); 2 = unique nonclustered index; 3 = clustered index; 32 = full-text index; 64 = spatial index; 128 = secondary index on a virtual generated column.N_FIELDSThe number of columns in the index key. For
GEN_CLUST_INDEXindexes, this value is 0 because the index is created using an artificial value rather than a real table column.PAGE_NOThe root page number of the index B-tree. For full-text indexes, the
PAGE_NOcolumn is unused and set to -1 (FIL_NULL) because the full-text index is laid out in several B-trees (auxiliary tables).SPACEAn identifier for the tablespace where the index resides. 0 means the
InnoDBsystem tablespace. Any other number represents a table created with a separate.ibdfile in file-per-table mode. This identifier stays the same after aTRUNCATE TABLEstatement. Because all indexes for a table reside in the same tablespace as the table, this value is not necessarily unique.MERGE_THRESHOLDThe merge threshold value for index pages. If the amount of data in an index page falls below the
MERGE_THRESHOLDvalue when a row is deleted or when a row is shortened by an update operation,InnoDBattempts to merge the index page with the neighboring index page. The default threshold value is 50%. For more information, see Section 15.8.11, “Configuring the Merge Threshold for Index Pages”.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_INDEXES WHERE TABLE_ID = 34\G
*************************** 1. row ***************************
INDEX_ID: 39
NAME: GEN_CLUST_INDEX
TABLE_ID: 34
TYPE: 1
N_FIELDS: 0
PAGE_NO: 3
SPACE: 23
MERGE_THRESHOLD: 50
*************************** 2. row ***************************
INDEX_ID: 40
NAME: i1
TABLE_ID: 34
TYPE: 0
N_FIELDS: 1
PAGE_NO: 4
SPACE: 23
MERGE_THRESHOLD: 50
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_LOCKS table provides
information about each lock that an InnoDB
transaction has requested but not yet acquired, and each lock that
a transaction holds that is blocking another transaction.
This table is deprecated and is removed as of MySQL 8.0.1. Use
the Performance Schema data_locks
table instead. See
Section 27.12.13.1, “The data_locks Table”.
Differences between INNODB_LOCKS
and data_locks:
If a transaction holds a lock,
INNODB_LOCKSdisplays the lock only if another transaction is waiting for it.data_locksdisplays the lock regardless of whether any transaction is waiting for it.The
data_lockstable has no columns corresponding toLOCK_SPACE,LOCK_PAGE, orLOCK_REC.The
INNODB_LOCKStable requires the globalPROCESSprivilege. Thedata_lockstable requires the usual Performance Schema privilege ofSELECTon the table to be selected from.
The following table shows the mapping from
INNODB_LOCKS columns to
data_locks columns. Use this
information to migrate applications from one table to the other.
Table 26.4 Mapping from INNODB_LOCKS to data_locks Columns
| INNODB_LOCKS Column | data_locks Column |
|---|---|
LOCK_ID |
ENGINE_LOCK_ID |
LOCK_TRX_ID |
ENGINE_TRANSACTION_ID |
LOCK_MODE |
LOCK_MODE |
LOCK_TYPE |
LOCK_TYPE |
LOCK_TABLE (combined schema/table names) |
OBJECT_SCHEMA (schema name),
OBJECT_NAME (table name) |
LOCK_INDEX |
INDEX_NAME |
LOCK_SPACE |
None |
LOCK_PAGE |
None |
LOCK_REC |
None |
LOCK_DATA |
LOCK_DATA |
The INNODB_LOCK_WAITS table contains
one or more rows for each blocked InnoDB
transaction, indicating the lock it has requested and any locks
that are blocking that request.
This table is deprecated and is removed as of MySQL 8.0.1. Use
the Performance Schema
data_lock_waits table instead. See
Section 27.12.13.2, “The data_lock_waits Table”.
The tables differ in the privileges required: The
INNODB_LOCK_WAITS table requires
the global PROCESS privilege. The
data_lock_waits table requires the
usual Performance Schema privilege of
SELECT on the table to be
selected from.
The following table shows the mapping from
INNODB_LOCK_WAITS columns to
data_lock_waits columns. Use this
information to migrate applications from one table to the other.
Table 26.5 Mapping from INNODB_LOCK_WAITS to data_lock_waits Columns
| INNODB_LOCK_WAITS Column | data_lock_waits Column |
|---|---|
REQUESTING_TRX_ID |
REQUESTING_ENGINE_TRANSACTION_ID |
REQUESTED_LOCK_ID |
REQUESTING_ENGINE_LOCK_ID |
BLOCKING_TRX_ID |
BLOCKING_ENGINE_TRANSACTION_ID |
BLOCKING_LOCK_ID |
BLOCKING_ENGINE_LOCK_ID |
The INNODB_METRICS table provides a
wide variety of InnoDB performance information,
complementing the specific focus areas of the Performance Schema
tables for InnoDB. With simple queries, you can
check the overall health of the system. With more detailed
queries, you can diagnose issues such as performance bottlenecks,
resource shortages, and application issues.
Each monitor represents a point within the
InnoDB source code that is instrumented to
gather counter information. Each counter can be started, stopped,
and reset. You can also perform these actions for a group of
counters using their common module name.
By default, relatively little data is collected. To start, stop,
and reset counters, set one of the system variables
innodb_monitor_enable,
innodb_monitor_disable,
innodb_monitor_reset, or
innodb_monitor_reset_all, using
the name of the counter, the name of the module, a wildcard match
for such a name using the “%” character, or the
special keyword all.
For usage information, see Section 15.15.6, “InnoDB INFORMATION_SCHEMA Metrics Table”.
The INNODB_METRICS table has these
columns:
NAMEA unique name for the counter.
SUBSYSTEMThe aspect of
InnoDBthat the metric applies to.COUNTThe value since the counter was enabled.
MAX_COUNTThe maximum value since the counter was enabled.
MIN_COUNTThe minimum value since the counter was enabled.
AVG_COUNTThe average value since the counter was enabled.
COUNT_RESETThe counter value since it was last reset. (The
_RESETcolumns act like the lap counter on a stopwatch: you can measure the activity during some time interval, while the cumulative figures are still available inCOUNT,MAX_COUNT, and so on.)MAX_COUNT_RESETThe maximum counter value since it was last reset.
MIN_COUNT_RESETThe minimum counter value since it was last reset.
AVG_COUNT_RESETThe average counter value since it was last reset.
TIME_ENABLEDThe timestamp of the last start.
TIME_DISABLEDThe timestamp of the last stop.
TIME_ELAPSEDThe elapsed time in seconds since the counter started.
TIME_RESETThe timestamp of the last reset.
STATUSWhether the counter is still running (
enabled) or stopped (disabled).TYPEWhether the item is a cumulative counter, or measures the current value of some resource.
COMMENTThe counter description.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME='dml_inserts'\G
*************************** 1. row ***************************
NAME: dml_inserts
SUBSYSTEM: dml
COUNT: 3
MAX_COUNT: 3
MIN_COUNT: NULL
AVG_COUNT: 0.046153846153846156
COUNT_RESET: 3
MAX_COUNT_RESET: 3
MIN_COUNT_RESET: NULL
AVG_COUNT_RESET: NULL
TIME_ENABLED: 2014-12-04 14:18:28
TIME_DISABLED: NULL
TIME_ELAPSED: 65
TIME_RESET: NULL
STATUS: enabled
TYPE: status_counter
COMMENT: Number of rows inserted
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.Transaction counter
COUNTvalues may differ from the number of transaction events reported in Performance SchemaEVENTS_TRANSACTIONS_SUMMARYtables.InnoDBcounts only those transactions that it executes, whereas Performance Schema collects events for all non-aborted transactions initiated by the server, including empty transactions.
The INNODB_SESSION_TEMP_TABLESPACES
table provides metadata about session temporary tablespaces used
for internal and user-created temporary tables. This table was
added in MySQL 8.0.13.
The INNODB_SESSION_TEMP_TABLESPACES
table has these columns:
IDThe process or session ID.
SPACEThe tablespace ID. A range of 400 thousand space IDs is reserved for session temporary tablespaces. Session temporary tablespaces are recreated each time the server is started. Space IDs are not persisted when the server is shut down and may be reused.
PATHThe tablespace data file path. A session temporary tablespace has an
ibtfile extension.SIZEThe size of the tablespace, in bytes.
STATEThe state of the tablespace.
ACTIVEindicates that the tablespace is currently used by a session.INACTIVEindicates that the tablespace is in the pool of available session temporary tablespaces.PURPOSEThe purpose of the tablespace.
INTRINSICindicates that the tablespace is used for optimized internal temporary tables use by the optimizer.SLAVEindicates that the tablespace is allocated for storing user-created temporary tables on a replication slave.USERindicates that the tablespace is used for user-created temporary tables.NONEindicates that the tablespace is not in use.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_SESSION_TEMP_TABLESPACES;
+----+------------+----------------------------+-------+----------+-----------+
| ID | SPACE | PATH | SIZE | STATE | PURPOSE |
+----+------------+----------------------------+-------+----------+-----------+
| 8 | 4294566162 | ./#innodb_temp/temp_10.ibt | 81920 | ACTIVE | INTRINSIC |
| 8 | 4294566161 | ./#innodb_temp/temp_9.ibt | 98304 | ACTIVE | USER |
| 0 | 4294566153 | ./#innodb_temp/temp_1.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566154 | ./#innodb_temp/temp_2.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566155 | ./#innodb_temp/temp_3.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566156 | ./#innodb_temp/temp_4.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566157 | ./#innodb_temp/temp_5.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566158 | ./#innodb_temp/temp_6.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566159 | ./#innodb_temp/temp_7.ibt | 81920 | INACTIVE | NONE |
| 0 | 4294566160 | ./#innodb_temp/temp_8.ibt | 81920 | INACTIVE | NONE |
+----+------------+----------------------------+-------+----------+-----------+
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TABLES table provides
metadata about InnoDB tables.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_TABLES table has these
columns:
TABLE_IDAn identifier for the
InnoDBtable. This value is unique across all databases in the instance.NAMEThe name of the table, preceded by the schema (database) name where appropriate (for example,
test/t1). Names of databases and user tables are in the same case as they were originally defined, possibly influenced by thelower_case_table_namessetting.FLAGA numeric value that represents bit-level information about table format and storage characteristics.
N_COLSThe number of columns in the table. The number reported includes three hidden columns that are created by
InnoDB(DB_ROW_ID,DB_TRX_ID, andDB_ROLL_PTR). The number reported also includes virtual generated columns, if present.SPACEAn identifier for the tablespace where the table resides. 0 means the
InnoDBsystem tablespace. Any other number represents either a file-per-table tablespace or a general tablespace. This identifier stays the same after aTRUNCATE TABLEstatement. For file-per-table tablespaces, this identifier is unique for tables across all databases in the instance.ROW_FORMATThe table's row format (
Compact,Redundant,Dynamic, orCompressed).ZIP_PAGE_SIZEThe zip page size. Applies only to tables with a row format of
Compressed.SPACE_TYPEThe type of tablespace to which the table belongs. Possible values include
Systemfor the system tablespace,Generalfor general tablespaces, andSinglefor file-per-table tablespaces. Tables assigned to the system tablespace usingCREATE TABLEorALTER TABLETABLESPACE=innodb_systemhave aSPACE_TYPEofGeneral. For more information, seeCREATE TABLESPACE.INSTANT_COLSThe number of columns in the table prior to adding the first instant column using
ALTER TABLE ... ADD COLUMNwithALGORITHM=INSTANT.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE TABLE_ID = 214\G
*************************** 1. row ***************************
TABLE_ID: 214
NAME: test/t1
FLAG: 129
N_COLS: 4
SPACE: 233
ROW_FORMAT: Compact
ZIP_PAGE_SIZE: 0
SPACE_TYPE: General
INSTANT_COLS: 0
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TABLESPACES table provides
metadata about InnoDB file-per-table, general,
and undo tablespaces.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INFORMATION_SCHEMA
FILES table reports metadata for
InnoDB tablespace types including
file-per-table tablespaces, general tablespaces, the system
tablespace, the global temporary tablespace, and undo
tablespaces.
The INNODB_TABLESPACES table has
these columns:
SPACEThe tablespace ID.
NAMEThe schema (database) and table name.
FLAGA numeric value that represents bit-level information about tablespace format and storage characteristics.
ROW_FORMATThe tablespace row format (
Compact or Redundant,DynamicorCompressed, orUndo). The data in this column is interpreted from the tablespace flag information that resides in the data file.There is no way to determine from this flag information if the tablespace row format is
RedundantorCompact, which is why one of the possibleROW_FORMATvalues isCompact or Redundant.PAGE_SIZEThe tablespace page size. The data in this column is interpreted from the tablespace flags information that resides in the
.ibdfile.ZIP_PAGE_SIZEThe tablespace zip page size. The data in this column is interpreted from the tablespace flags information that resides in the
.ibdfile.SPACE_TYPEThe type of tablespace. Possible values include
Generalfor general tablespaces,Singlefor file-per-table tablespaces,Systemfor the system tablespace, andUndofor undo tablespaces.FS_BLOCK_SIZEThe file system block size, which is the unit size used for hole punching. This column pertains to the
InnoDBtransparent page compression feature.FILE_SIZEThe apparent size of the file, which represents the maximum size of the file, uncompressed. This column pertains to the
InnoDBtransparent page compression feature.ALLOCATED_SIZEThe actual size of the file, which is the amount of space allocated on disk. This column pertains to the
InnoDBtransparent page compression feature.AUTOEXTEND_SIZEThe auto-extend size of the tablespace. This column was added in MySQL 8.0.23.
SERVER_VERSIONThe MySQL version that created the tablespace, or the MySQL version into which the tablespace was imported, or the version of the last major MySQL version upgrade. The value is unchanged by a release series upgrade, such as an upgrade from MySQL 8.0.
xto 8.0.y. The value can be considered a “creation” marker or “certified” marker for the tablespace.SPACE_VERSIONThe tablespace version, used to track changes to the tablespace format.
ENCRYPTIONWhether the tablespace is encrypted. This column was added in MySQL 8.0.13.
STATEThe tablespace state. This column was added in MySQL 8.0.14.
For file-per-table and general tablespaces, states include:
normal: The tablespace is normal and active.discarded: The tablespace was discarded by anALTER TABLE ... DISCARD TABLESPACEstatement.corrupted: The tablespace is identified byInnoDBas corrupted.
For undo tablespaces, states include:
active: Rollback segments in the undo tablespace can be allocated to new transactions.inactive: Rollback segments in the undo tablespace are no longer used by new transactions. The truncate process is in progress. The undo tablespace was either selected by the purge thread implicitly or was made inactive by anALTER UNDO TABLESPACE ... SET INACTIVEstatement.empty: The undo tablespace was truncated and is no longer active. It is ready to be dropped or made active again by anALTER UNDO TABLESPACE ... SET INACTIVEstatement.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES WHERE SPACE = 26\G
*************************** 1. row ***************************
SPACE: 26
NAME: test/t1
FLAG: 0
ROW_FORMAT: Compact or Redundant
PAGE_SIZE: 16384
ZIP_PAGE_SIZE: 0
SPACE_TYPE: Single
FS_BLOCK_SIZE: 4096
FILE_SIZE: 98304
ALLOCATED_SIZE: 65536
AUTOEXTEND_SIZE: 0
SERVER_VERSION: 8.0.23
SPACE_VERSION: 1
ENCRYPTION: N
STATE: normal
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TABLESPACES_BRIEF table
provides space ID, name, path, flag, and space type metadata for
file-per-table, general, undo, and system tablespaces.
INNODB_TABLESPACES provides the same
metadata but loads more slowly because other metadata provided by
the table, such as FS_BLOCK_SIZE,
FILE_SIZE, and
ALLOCATED_SIZE, must be loaded dynamically.
Space and path metadata is also provided by the
INNODB_DATAFILES table.
The INNODB_TABLESPACES_BRIEF table
has these columns:
SPACEThe tablespace ID.
NAMEThe tablespace name. For file-per-table tablespaces, the name is in the form of
schema/table_name.PATHThe tablespace data file path. If a file-per-table tablespace is created in a location outside the MySQL data directory, the path value is a fully qualified directory path. Otherwise, the path is relative to the data directory.
FLAGA numeric value that represents bit-level information about tablespace format and storage characteristics.
SPACE_TYPEThe type of tablespace. Possible values include
GeneralforInnoDBgeneral tablespaces,SingleforInnoDBfile-per-table tablespaces, andSystemfor theInnoDBsystem tablespace.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_BRIEF WHERE SPACE = 7;
+-------+---------+---------------+-------+------------+
| SPACE | NAME | PATH | FLAG | SPACE_TYPE |
+-------+---------+---------------+-------+------------+
| 7 | test/t1 | ./test/t1.ibd | 16417 | Single |
+-------+---------+---------------+-------+------------+
Notes
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TABLESTATS table provides
a view of low-level status information about
InnoDB tables. This data is used by the MySQL
optimizer to calculate which index to use when querying an
InnoDB table. This information is derived from
in-memory data structures rather than data stored on disk. There
is no corresponding internal InnoDB system
table.
InnoDB tables are represented in this view if
they have been opened since the last server restart and have not
aged out of the table cache. Tables for which persistent stats are
available are always represented in this view.
Table statistics are updated only for
DELETE or
UPDATE operations that modify
indexed columns. Statistics are not updated by operations that
modify only nonindexed columns.
ANALYZE TABLE clears table
statistics and sets the STATS_INITIALIZED
column to Uninitialized. Statistics are
collected again the next time the table is accessed.
For related usage information and examples, see Section 15.15.3, “InnoDB INFORMATION_SCHEMA Schema Object Tables”.
The INNODB_TABLESTATS table has these
columns:
TABLE_IDAn identifier representing the table for which statistics are available; the same value as
INNODB_TABLES.TABLE_ID.NAMEThe name of the table; the same value as
INNODB_TABLES.NAME.STATS_INITIALIZEDThe value is
Initializedif the statistics are already collected,Uninitializedif not.NUM_ROWSThe current estimated number of rows in the table. Updated after each DML operation. The value could be imprecise if uncommitted transactions are inserting into or deleting from the table.
CLUST_INDEX_SIZEThe number of pages on disk that store the clustered index, which holds the
InnoDBtable data in primary key order. This value might be null if no statistics are collected yet for the table.OTHER_INDEX_SIZEThe number of pages on disk that store all secondary indexes for the table. This value might be null if no statistics are collected yet for the table.
MODIFIED_COUNTERThe number of rows modified by DML operations, such as
INSERT,UPDATE,DELETE, and also cascade operations from foreign keys. This column is reset each time table statistics are recalculatedAUTOINCThe next number to be issued for any auto-increment-based operation. The rate at which the
AUTOINCvalue changes depends on how many times auto-increment numbers have been requested and how many numbers are granted per request.REF_COUNTWhen this counter reaches zero, the table metadata can be evicted from the table cache.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESTATS where TABLE_ID = 71\G
*************************** 1. row ***************************
TABLE_ID: 71
NAME: test/t1
STATS_INITIALIZED: Initialized
NUM_ROWS: 1
CLUST_INDEX_SIZE: 1
OTHER_INDEX_SIZE: 0
MODIFIED_COUNTER: 1
AUTOINC: 0
REF_COUNT: 1
Notes
This table is useful primarily for expert-level performance monitoring, or when developing performance-related extensions for MySQL.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TEMP_TABLE_INFO table
provides information about user-created InnoDB
temporary tables that are active in an InnoDB
instance. It does not provide information about internal
InnoDB temporary tables used by the optimizer.
The INNODB_TEMP_TABLE_INFO table is
created when first queried, exists only in memory, and is not
persisted to disk.
For usage information and examples, see Section 15.15.7, “InnoDB INFORMATION_SCHEMA Temporary Table Info Table”.
The INNODB_TEMP_TABLE_INFO table has
these columns:
TABLE_IDThe table ID of the temporary table.
NAMEThe name of the temporary table.
N_COLSThe number of columns in the temporary table. The number includes three hidden columns created by
InnoDB(DB_ROW_ID,DB_TRX_ID, andDB_ROLL_PTR).SPACEThe ID of the temporary tablespace where the temporary table resides.
Example
mysql>CREATE TEMPORARY TABLE t1 (c1 INT PRIMARY KEY) ENGINE=INNODB;mysql>SELECT * FROM INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO\G*************************** 1. row *************************** TABLE_ID: 97 NAME: #sql8c88_43_0 N_COLS: 4 SPACE: 76
Notes
This table is useful primarily for expert-level monitoring.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_TRX table provides
information about every transaction currently executing inside
InnoDB, including whether the transaction is
waiting for a lock, when the transaction started, and the SQL
statement the transaction is executing, if any.
For usage information, see Section 15.15.2.1, “Using InnoDB Transaction and Locking Information”.
The INNODB_TRX table has these
columns:
TRX_IDA unique transaction ID number, internal to
InnoDB. These IDs are not created for transactions that are read only and nonlocking. For details, see Section 8.5.3, “Optimizing InnoDB Read-Only Transactions”.TRX_WEIGHTThe weight of a transaction, reflecting (but not necessarily the exact count of) the number of rows altered and the number of rows locked by the transaction. To resolve a deadlock,
InnoDBselects the transaction with the smallest weight as the “victim” to roll back. Transactions that have changed nontransactional tables are considered heavier than others, regardless of the number of altered and locked rows.TRX_STATEThe transaction execution state. Permitted values are
RUNNING,LOCK WAIT,ROLLING BACK, andCOMMITTING.TRX_STARTEDThe transaction start time.
TRX_REQUESTED_LOCK_IDThe ID of the lock the transaction is currently waiting for, if
TRX_STATEisLOCK WAIT; otherwiseNULL. To obtain details about the lock, join this column with theENGINE_LOCK_IDcolumn of the Performance Schemadata_lockstable.TRX_WAIT_STARTEDThe time when the transaction started waiting on the lock, if
TRX_STATEisLOCK WAIT; otherwiseNULL.TRX_MYSQL_THREAD_IDThe MySQL thread ID. To obtain details about the thread, join this column with the
IDcolumn of theINFORMATION_SCHEMAPROCESSLISTtable, but see Section 15.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking Information”.TRX_QUERYThe SQL statement that is being executed by the transaction.
TRX_OPERATION_STATEThe transaction's current operation, if any; otherwise
NULL.TRX_TABLES_IN_USEThe number of
InnoDBtables used while processing the current SQL statement of this transaction.TRX_TABLES_LOCKEDThe number of
InnoDBtables that the current SQL statement has row locks on. (Because these are row locks, not table locks, the tables can usually still be read from and written to by multiple transactions, despite some rows being locked.)TRX_LOCK_STRUCTSThe number of locks reserved by the transaction.
TRX_LOCK_MEMORY_BYTESThe total size taken up by the lock structures of this transaction in memory.
TRX_ROWS_LOCKEDThe approximate number or rows locked by this transaction. The value might include delete-marked rows that are physically present but not visible to the transaction.
TRX_ROWS_MODIFIEDThe number of modified and inserted rows in this transaction.
TRX_CONCURRENCY_TICKETSA value indicating how much work the current transaction can do before being swapped out, as specified by the
innodb_concurrency_ticketssystem variable.TRX_ISOLATION_LEVELThe isolation level of the current transaction.
TRX_UNIQUE_CHECKSWhether unique checks are turned on or off for the current transaction. For example, they might be turned off during a bulk data load.
TRX_FOREIGN_KEY_CHECKSWhether foreign key checks are turned on or off for the current transaction. For example, they might be turned off during a bulk data load.
TRX_LAST_FOREIGN_KEY_ERRORThe detailed error message for the last foreign key error, if any; otherwise
NULL.TRX_ADAPTIVE_HASH_LATCHEDWhether the adaptive hash index is locked by the current transaction. When the adaptive hash index search system is partitioned, a single transaction does not lock the entire adaptive hash index. Adaptive hash index partitioning is controlled by
innodb_adaptive_hash_index_parts, which is set to 8 by default.TRX_ADAPTIVE_HASH_TIMEOUTWhether to relinquish the search latch immediately for the adaptive hash index, or reserve it across calls from MySQL. When there is no adaptive hash index contention, this value remains zero and statements reserve the latch until they finish. During times of contention, it counts down to zero, and statements release the latch immediately after each row lookup. When the adaptive hash index search system is partitioned (controlled by
innodb_adaptive_hash_index_parts), the value remains 0.TRX_IS_READ_ONLYA value of 1 indicates the transaction is read only.
TRX_AUTOCOMMIT_NON_LOCKINGA value of 1 indicates the transaction is a
SELECTstatement that does not use theFOR UPDATEorLOCK IN SHARED MODEclauses, and is executing withautocommitenabled so that the transaction contains only this one statement. When this column andTRX_IS_READ_ONLYare both 1,InnoDBoptimizes the transaction to reduce the overhead associated with transactions that change table data.TRX_SCHEDULE_WEIGHTThe transaction schedule weight assigned by the Contention-Aware Transaction Scheduling (CATS) algorithm to transactions waiting for a lock. The value is relative to the values of other transactions. A higher value has a greater weight. A value is computed only for transactions in a
LOCK WAITstate, as reported by theTRX_STATEcolumn. A NULL value is reported for transactions that are not waiting for a lock. TheTRX_SCHEDULE_WEIGHTvalue is different from theTRX_WEIGHTvalue, which is computed by a different algorithm for a different purpose.
Example
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G
*************************** 1. row ***************************
trx_id: 1510
trx_state: RUNNING
trx_started: 2014-11-19 13:24:40
trx_requested_lock_id: NULL
trx_wait_started: NULL
trx_weight: 586739
trx_mysql_thread_id: 2
trx_query: DELETE FROM employees.salaries WHERE salary > 65000
trx_operation_state: updating or deleting
trx_tables_in_use: 1
trx_tables_locked: 1
trx_lock_structs: 3003
trx_lock_memory_bytes: 450768
trx_rows_locked: 1407513
trx_rows_modified: 583736
trx_concurrency_tickets: 0
trx_isolation_level: REPEATABLE READ
trx_unique_checks: 1
trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
trx_adaptive_hash_latched: 0
trx_adaptive_hash_timeout: 10000
trx_is_read_only: 0
trx_autocommit_non_locking: 0
trx_schedule_weight: NULL
Notes
Use this table to help diagnose performance problems that occur during times of heavy concurrent load. Its contents are updated as described in Section 15.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking Information”.
You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
The INNODB_VIRTUAL table provides
metadata about InnoDB
virtual generated
columns and columns upon which virtual generated columns
are based.
A row appears in the INNODB_VIRTUAL
table for each column upon which a virtual generated column is
based.
The INNODB_VIRTUAL table has these
columns:
TABLE_IDAn identifier representing the table associated with the virtual column; the same value as
INNODB_TABLES.TABLE_ID.POSThe position value of the virtual generated column. The value is large because it encodes the column sequence number and ordinal position. The formula used to calculate the value uses a bitwise operation:
((
nth virtual generated column for the InnoDB instance + 1) << 16) + the ordinal position of the virtual generated columnFor example, if the first virtual generated column in the
InnoDBinstance is the third column of the table, the formula is(0 + 1) << 16) + 2. The first virtual generated column in theInnoDBinstance is always number 0. As the third column in the table, the ordinal position of the virtual generated column is 2. Ordinal positions are counted from 0.BASE_POSThe ordinal position of the columns upon which a virtual generated column is based.
Example
mysql>CREATE TABLE `t1` (`a` int(11) DEFAULT NULL,`b` int(11) DEFAULT NULL,`c` int(11) GENERATED ALWAYS AS (a+b) VIRTUAL,`h` varchar(10) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;mysql>SELECT * FROM INFORMATION_SCHEMA.INNODB_VIRTUALWHERE TABLE_ID IN(SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_TABLESWHERE NAME LIKE "test/t1");+----------+-------+----------+ | TABLE_ID | POS | BASE_POS | +----------+-------+----------+ | 98 | 65538 | 0 | | 98 | 65538 | 1 | +----------+-------+----------+
Notes
If a constant value is assigned to a virtual generated column, as in the following table, an entry for the column does not appear in the
INNODB_VIRTUALtable. For an entry to appear, a virtual generated column must have a base column.CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) GENERATED ALWAYS AS (5) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
However, metadata for such a column does appear in the
INNODB_COLUMNStable.You must have the
PROCESSprivilege to query this table.Use the
INFORMATION_SCHEMACOLUMNStable or theSHOW COLUMNSstatement to view additional information about the columns of this table, including data types and default values.
As of MySQL 8.0.14, the thread pool
INFORMATION_SCHEMA tables are also available as
Performance Schema tables. (See
Section 27.12.16, “Performance Schema Thread Pool Tables”.) The
INFORMATION_SCHEMA tables are deprecated;
expect them be removed in a future version of MySQL. Applications
should transition away from the old tables to the new tables. For
example, if an application uses this query:
SELECT * FROM INFORMATION_SCHEMA.TP_THREAD_STATE;
The application should use this query instead:
SELECT * FROM performance_schema.tp_thread_state;
The following sections describe the
INFORMATION_SCHEMA tables associated with the
thread pool plugin (see Section 5.6.3, “MySQL Enterprise Thread Pool”). They provide
information about thread pool operation:
TP_THREAD_GROUP_STATE: Information about thread pool thread group statesTP_THREAD_GROUP_STATS: Thread group statisticsTP_THREAD_STATE: Information about thread pool thread states
Rows in these tables represent snapshots in time. In the case of
TP_THREAD_STATE, all rows for a thread group
comprise a snapshot in time. Thus, the MySQL server holds the mutex
of the thread group while producing the snapshot. But it does not
hold mutexes on all thread groups at the same time, to prevent a
statement against TP_THREAD_STATE from blocking
the entire MySQL server.
The INFORMATION_SCHEMA thread pool tables are
implemented by individual plugins and the decision whether to load
one can be made independently of the others (see
Section 5.6.3.2, “Thread Pool Installation”). However, the content of
all the tables depends on the thread pool plugin being enabled. If a
table plugin is enabled but the thread pool plugin is not, the table
becomes visible and can be accessed but is empty.
As of MySQL 8.0.14, the thread pool
INFORMATION_SCHEMA tables are also available
as Performance Schema tables. (See
Section 27.12.16, “Performance Schema Thread Pool Tables”.) The
INFORMATION_SCHEMA tables are deprecated;
expect them to be removed in a future version of MySQL.
Applications should transition away from the old tables to the
new tables. For example, if an application uses this query:
SELECT * FROM INFORMATION_SCHEMA.TP_THREAD_GROUP_STATE;
The application should use this query instead:
SELECT * FROM performance_schema.tp_thread_group_state;
The TP_THREAD_GROUP_STATE table has one row per
thread group in the thread pool. Each row provides information
about the current state of a group.
For descriptions of the columns in the
INFORMATION_SCHEMA
TP_THREAD_GROUP_STATE table, see
Section 27.12.16.1, “The tp_thread_group_state Table”.
The Performance Schema
tp_thread_group_state table has
equivalent columns.
As of MySQL 8.0.14, the thread pool
INFORMATION_SCHEMA tables are also available
as Performance Schema tables. (See
Section 27.12.16, “Performance Schema Thread Pool Tables”.) The
INFORMATION_SCHEMA tables are deprecated;
expect them to be removed in a future version of MySQL.
Applications should transition away from the old tables to the
new tables. For example, if an application uses this query:
SELECT * FROM INFORMATION_SCHEMA.TP_THREAD_GROUP_STATS;
The application should use this query instead:
SELECT * FROM performance_schema.tp_thread_group_stats;
The TP_THREAD_GROUP_STATS table reports
statistics per thread group. There is one row per group.
For descriptions of the columns in the
INFORMATION_SCHEMA
TP_THREAD_GROUP_STATS table, see
Section 27.12.16.2, “The tp_thread_group_stats Table”.
The Performance Schema
tp_thread_group_stats table has
equivalent columns.
As of MySQL 8.0.14, the thread pool
INFORMATION_SCHEMA tables are also available
as Performance Schema tables. (See
Section 27.12.16, “Performance Schema Thread Pool Tables”.) The
INFORMATION_SCHEMA tables are deprecated;
expect them to be removed in a future version of MySQL.
Applications should transition away from the old tables to the
new tables. For example, if an application uses this query:
SELECT * FROM INFORMATION_SCHEMA.TP_THREAD_STATE;
The application should use this query instead:
SELECT * FROM performance_schema.tp_thread_state;
The TP_THREAD_STATE table has one row per
thread created by the thread pool to handle connections.
For descriptions of the columns in the
INFORMATION_SCHEMA
TP_THREAD_STATE table, see
Section 27.12.16.3, “The tp_thread_state Table”. The
Performance Schema tp_thread_state
table has equivalent columns.
The following sections describe the
INFORMATION_SCHEMA tables associated with the
CONNECTION_CONTROL plugin.
This table provides information about the current number of consecutive failed connection attempts per account (user/host combination).
CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS
has these columns:
USERHOSTThe user/host combination indicating an account that has failed connection attempts, in
'format.user_name'@'host_name'FAILED_ATTEMPTSThe current number of consecutive failed connection attempts for the
USERHOSTvalue. This counts all failed attempts, regardless of whether they were delayed. The number of attempts for which the server added a delay to its response is the difference between theFAILED_ATTEMPTSvalue and theconnection_control_failed_connections_thresholdsystem variable value.
Notes
The
CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTSplugin must be activated for this table to be available, and theCONNECTION_CONTROLplugin must be activated or the table contents are always empty. See Section 6.4.2, “The Connection-Control Plugins”.The table contains rows only for accounts that have had one or more consecutive failed connection attempts without a subsequent successful attempt. When an account connects successfully, its failed-connection count is reset to zero and the server removes any row corresponding to the account.
Assigning a value to the
connection_control_failed_connections_thresholdsystem variable at runtime resets all accumulated failed-connection counters to zero, which causes the table to become empty.
The following sections describe the
INFORMATION_SCHEMA tables associated with MySQL Enterprise Firewall
(see Section 6.4.7, “MySQL Enterprise Firewall”). They provide views into the
firewall in-memory data cache. These tables are available only if
the appropriate firewall plugins are enabled.
The MYSQL_FIREWALL_USERS table
provides a view into the in-memory data cache for MySQL Enterprise Firewall. It lists
names and operational modes of registered firewall account
profiles. It is used in conjunction with the
mysql.firewall_users system table that provides
persistent storage of firewall data; see
MySQL Enterprise Firewall Tables.
The MYSQL_FIREWALL_USERS table has
these columns:
USERHOSTThe account profile name. Each account name has the format
.user_name@host_nameMODEThe current operational mode for the profile. Permitted mode values are
OFF,DETECTING,PROTECTING,RECORDING, andRESET. For details about their meanings, see Firewall Operational Concepts.
The MYSQL_FIREWALL_WHITELIST table
provides a view into the in-memory data cache for MySQL Enterprise Firewall. It lists
allowlist rules of registered firewall account profiles. It is
used in conjunction with the
mysql.firewall_whitelist system table that
provides persistent storage of firewall data; see
MySQL Enterprise Firewall Tables.
The MYSQL_FIREWALL_WHITELIST table
has these columns:
USERHOSTThe account profile name. Each account name has the format
.user_name@host_nameRULEA normalized statement indicating an acceptable statement pattern for the profile. A profile allowlist is the union of its rules.
Some extensions to SHOW statements
accompany the implementation of
INFORMATION_SCHEMA:
INFORMATION_SCHEMA is an information database,
so its name is included in the output from
SHOW DATABASES. Similarly,
SHOW TABLES can be used with
INFORMATION_SCHEMA to obtain a list of its
tables:
mysql> SHOW TABLES FROM INFORMATION_SCHEMA;
+---------------------------------------+
| Tables_in_INFORMATION_SCHEMA |
+---------------------------------------+
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENGINES |
| EVENTS |
| FILES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
| REFERENTIAL_CONSTRAINTS |
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+---------------------------------------+
SHOW COLUMNS and
DESCRIBE can display information
about the columns in individual
INFORMATION_SCHEMA tables.
SHOW statements that accept a
LIKE clause to limit the rows
displayed also permit a WHERE clause that
specifies more general conditions that selected rows must satisfy:
SHOW CHARACTER SET SHOW COLLATION SHOW COLUMNS SHOW DATABASES SHOW FUNCTION STATUS SHOW INDEX SHOW OPEN TABLES SHOW PROCEDURE STATUS SHOW STATUS SHOW TABLE STATUS SHOW TABLES SHOW TRIGGERS SHOW VARIABLES
The WHERE clause, if present, is evaluated
against the column names displayed by the
SHOW statement. For example, the
SHOW CHARACTER SET statement
produces these output columns:
mysql> SHOW CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| dec8 | DEC West European | dec8_swedish_ci | 1 |
| cp850 | DOS West European | cp850_general_ci | 1 |
| hp8 | HP West European | hp8_english_ci | 1 |
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 |
| latin1 | cp1252 West European | latin1_swedish_ci | 1 |
| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |
...
To use a WHERE clause with
SHOW CHARACTER SET, you would refer
to those column names. As an example, the following statement
displays information about character sets for which the default
collation contains the string 'japanese':
mysql> SHOW CHARACTER SET WHERE `Default collation` LIKE '%japanese%';
+---------+---------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+---------------------------+---------------------+--------+
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 |
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |
+---------+---------------------------+---------------------+--------+
This statement displays the multibyte character sets:
mysql> SHOW CHARACTER SET WHERE Maxlen > 1;
+---------+---------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+---------------------------+---------------------+--------+
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 |
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |
| euckr | EUC-KR Korean | euckr_korean_ci | 2 |
| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 |
| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 |
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 |
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |
+---------+---------------------------+---------------------+--------+