Metadatabases and data dictionaries
PolarDB-X uses INFORMATION_SCHEMA as its metadatabase, compatible with the MySQL metadatabase. Query it over a Java Database Connectivity (JDBC) connection using standard SQL statements.
What you can inspect
Use the following table to find the INFORMATION_SCHEMA table for each object type.
Object | INFORMATION_SCHEMA table |
Databases |
|
Tables |
|
Columns |
|
Indexes |
|
Global secondary indexes |
|
Table groups |
|
Partitions |
|
Metadata locks |
|
Concurrency control rules |
|
Plan caches |
|
Sequences |
|
SQL statement summaries |
|
MySQL-compatible tables
The following INFORMATION_SCHEMA tables behave the same as in MySQL 5.7.
Table | Description |
| Database metadata |
| Table metadata |
| Column metadata |
| Index metadata |
| Available storage engines |
| Reserved keywords |
| Supported collations |
| Table constraints |
| Active connections and running statements |
| Session-level system variables |
| Global system variables |
| InnoDB lock information |
| Active InnoDB transactions |
| InnoDB buffer pool page details |
| InnoDB buffer pool statistics |
| InnoDB buffer pool LRU list |
| InnoDB lock wait relationships |
| User privilege grants |
Two tables are partially compatible:
COLUMN_STATISTICS: Histograms are generated based on data processed by PolarDB-X and stored in a format specific to PolarDB-X.PARTITIONS: Only partitioned tables in the current PolarDB-X database have partitions.
PolarDB-X extension tables
The following tables expose distributed database concepts specific to PolarDB-X. All tables are scoped to the current PolarDB-X database.
Table | Description |
| Hybrid transactional and analytical processing (HTAP) workloads |
| Global secondary indexes (GSIs) |
| Metadata locks (MDLs) |
| Table groups |
| Partitions in partitioned tables |
| Locality settings for databases and tables |
| SQL statements pushed down from compute nodes to data nodes for execution |
| Execution plan caches |
| Statistics tasks |
| Concurrency control (CCL) rules |
| CCL triggers |
| Summary of SQL statements executed in the current statistical period |
| Summary of SQL statements executed in previous statistical periods |
| Sequences |
| Local index (LSI) usage statistics at the physical partition level |
| Local index (LSI) usage statistics aggregated at the logical table level |
Unsupported tables
The following tables exist in MySQL 5.7 but are not implemented in PolarDB-X.
SCHEMA_PRIVILEGES, TABLE_PRIVILEGES, INNODB_TEMP_TABLE_INFO, INNODB_SYS_INDEXES, INNODB_SYS_FIELDS, INNODB_CMP_PER_INDEX_RESET, INNODB_FT_DEFAULT_STOPWORD, INNODB_FT_INDEX_TABLE, INNODB_FT_INDEX_CACHE, INNODB_SYS_TABLESPACES, INNODB_METRICS, INNODB_SYS_FOREIGN_COLS, INNODB_CMPMEM, INNODB_SYS_COLUMNS, INNODB_SYS_FOREIGN, INNODB_SYS_TABLESTATS, INNODB_FT_CONFIG, INNODB_SYS_VIRTUAL, INNODB_CMP, INNODB_FT_BEING_DELETED, INNODB_CMP_PER_INDEX, INNODB_CMPMEM_RESET, INNODB_CMP_RESET, INNODB_FT_DELETED, INNODB_SYS_TABLES, INNODB_SYS_DATAFILES, PROFILING, REFERENTIAL_CONSTRAINTS, SESSION_STATUS, TABLESPACES, EVENTS, TRIGGERS, ROUTINES, COLUMN_PRIVILEGES, FILES, KEY_COLUMN_USAGE, OPTIMIZER_TRACE, PARAMETERS, CHARACTER_SETS, COLLATION_CHARACTER_SET_APPLICABILITY, PLUGINS
Table column reference
SCHEMATA
Stores metadata about the current database.
Column | Description |
| Catalog name. Value: |
| Database name |
| Default character set |
| Default collation |
| Always |
TABLES
Stores metadata about database tables.
Column | Description |
| Catalog name. Value: |
| Database name |
| Table name |
| Storage engine |
| Version number |
| Row format |
| Estimated number of rows |
| Average row length |
| Estimated size of the base table |
| Maximum table size. Default: |
| Estimated size of the index |
| Free storage space |
| Next |
| Table creation time |
| Most recent update time |
| Last check time. Value: |
| Default collation |
| Table checksum |
| Options from the |
| Table comment |
COLUMNS
Stores metadata about columns.
Column | Description |
| Catalog name. Value: |
| Database name |
| Table name |
| Column name |
| Column position in the table |
| Default value |
| Whether |
| Data type, without precision |
| Maximum length in characters |
| Maximum length in bytes |
| Precision of numeric values |
| Scale of numeric values |
| Precision of datetime values |
| Character set name |
| Collation name |
| Column type, including precision |
| Index type on the column |
| Additional column information |
| Column privileges |
| Column comment |
| Expression for generated columns |
STATISTICS
Stores metadata about indexes.
Column | Description |
| Catalog name of the base table. Value: |
| Schema name of the base table |
| Table name |
| Whether the index allows duplicate values |
| Schema name of the index |
| Index name |
| Column sequence number in the index |
| Column name |
| Column collation information |
| Column cardinality |
| Index prefix length |
| Compressed index information |
| Whether the column can contain |
| Index type |
| Index comment (not per-column) |
| Index comment |
PHYSICAL_INDEX_USAGE
Stores local index (LSI) usage statistics for each physical partition on each data node.
Column | Description |
| Physical schema name (the actual schema name on the data node) |
| Physical table name (the actual table name on the data node) |
| Index name |
| Total number of index accesses (reads + writes) |
| Logical schema name |
| Logical table name. For a GSI table, this is the GSI table name. |
| Number of index read accesses |
| Total index wait time (unit: picoseconds) |
| Maximum single index wait time (unit: picoseconds) |
LOGICAL_INDEX_USAGE
Stores local index (LSI) usage statistics aggregated across all physical partitions for each logical table.
Column | Description |
| Logical schema name |
| Logical table name. For a GSI table, this is the corresponding primary table name. |
| Global secondary index (GSI) name. Empty for non-GSI indexes. |
| Index name |
| Total number of index accesses across all partitions (reads + writes) |
| Number of partitions |
| Average usage per partition (TOTAL_USAGE / PARTITION_COUNT) |
| Total number of index read accesses across all partitions |
| Total index wait time across all partitions (unit: picoseconds) |
| Maximum single index wait time across all partitions (unit: picoseconds) |
STATEMENTS_SUMMARY and STATEMENTS_SUMMARY_HISTORY
STATEMENTS_SUMMARY summarizes SQL statements executed in the current statistical period. STATEMENTS_SUMMARY_HISTORY covers the previous 24 statistical periods. Both tables group statements by SQL template.
Default settings:
Statistical period: 30 minutes
Maximum statements tracked per period: 1,000
Both tables share the same columns, organized below by diagnostic purpose.
Identification fields
Column | Description |
| Start time of the statistical period |
| Database name |
| Statement type |
| SQL template ID |
| Hash value of the execution plan |
| SQL template |
| First time the template was collected |
| Most recent time the template was collected |
| Sample SQL statement |
| Template ID of the preceding SQL statement |
| Sample of the preceding SQL statement |
| Trace ID of the sample statement |
| Workload type: |
| Execution mode: |
Execution count and error fields
Column | Description |
| Number of executions |
| Number of execution errors |
| Total rows returned or updated |
| Average rows returned or updated |
| Maximum rows returned or updated |
Response time fields (unit: ms)
Column | Description |
| Total response time |
| Average response time |
| Maximum response time |
Transaction time fields (unit: ms)
Transaction time is the duration from the start of the transaction to the completion of the statement.
Column | Description |
| Total transaction time |
| Average transaction time |
| Maximum transaction time |
Execution plan CPU time fields (unit: ms)
Column | Description |
| Total CPU time to build execution plans |
| Average CPU time to build an execution plan |
| Maximum CPU time to build an execution plan |
| Total CPU time to run execution plans |
| Average CPU time to run an execution plan |
| Maximum CPU time to run an execution plan |
Physical pushdown fields
These fields measure the time and row counts for SQL statements pushed down from compute nodes to data nodes.
Column | Description |
| Total pushdown time (ms) |
| Average pushdown time (ms) |
| Maximum pushdown time (ms) |
| Total number of physical SQL executions |
| Average number of physical SQL executions |
| Maximum number of physical SQL executions |
| Total rows retrieved by physical SQL queries |
| Average rows retrieved per physical SQL query |
| Maximum rows retrieved by a physical SQL query |
What's next
For a complete reference of INFORMATION_SCHEMA tables, see the MySQL 5.7 documentation.