From e94045299b076dc74eb78e0640e5566ff833abe5 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Sun, 5 Jul 2020 20:18:42 -0600 Subject: [PATCH 01/14] WIP - refactor system tables --- TOC.md | 4 +- .../system-table-information-schema.md | 93 ++++++++++++++----- 2 files changed, 71 insertions(+), 26 deletions(-) diff --git a/TOC.md b/TOC.md index 81c2d16e9f1e4..8e27065b614ed 100644 --- a/TOC.md +++ b/TOC.md @@ -356,10 +356,9 @@ + [Views](/views.md) + [Partitioning](/partitioned-table.md) + [Character Set and Collation](/character-set-and-collation.md) - + System Tables + + System Databases + [`mysql`](/system-tables/system-table-overview.md) + [`information_schema`](/system-tables/system-table-information-schema.md) - + sql-diagnosis + [`cluster_info`](/system-tables/system-table-cluster-info.md) + [`cluster_hardware`](/system-tables/system-table-cluster-hardware.md) + [`cluster_config`](/system-tables/system-table-cluster-config.md) @@ -371,6 +370,7 @@ + [`metrics_summary`](/system-tables/system-table-metrics-summary.md) + [`inspection_result`](/system-tables/system-table-inspection-result.md) + [`inspection_summary`](/system-tables/system-table-inspection-summary.md) + + [`metrics_schema`](#) + UI + TiDB Dashboard + [Overview](/dashboard/dashboard-intro.md) diff --git a/system-tables/system-table-information-schema.md b/system-tables/system-table-information-schema.md index 548501c6cd00a..639d39735f84d 100644 --- a/system-tables/system-table-information-schema.md +++ b/system-tables/system-table-information-schema.md @@ -1,13 +1,80 @@ --- title: Information Schema -summary: Learn how to use Information Schema in TiDB. +summary: TiDB implements the ANSI-standard information_schema for viewing system metadata. category: reference aliases: ['/docs/dev/system-tables/system-table-information-schema/','/docs/dev/reference/system-databases/information-schema/'] --- # Information Schema -As part of MySQL compatibility, TiDB supports a number of `INFORMATION_SCHEMA` tables. Many of these tables also have a corresponding `SHOW` command. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables. +Information Schema is an ANSI-standard way of viewing system metadata. In addition to providing many of the `INFORMATION_SCHEMA` tables available in MySQL, TiDB also provides a number of extensions. + +Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables. + +| Table Name | TiDB Extension | Description | +|------------------------------|----------------|-------------| +| `ANALYZE_STATUS` | Yes | Provides information about tasks to collect statistics. | +| `CHARACTER_SETS` | No | Provides a list of character sets the server supports. | +| `CLUSTER_CONFIG` | Yes | Provides details about configuration settings for the entire TiDB cluster. | +| `CLUSTER_HARDWARE` | Yes | Provides details on the underlying physical hardware discovered on each TiDB component. | +| `CLUSTER_INFO` | Yes | TODO | +| `CLUSTER_LOAD` | Yes | TODO | +| `CLUSTER_LOG` | Yes | Provides a log for the entire TiDB cluster | +| `CLUSTER_PROCESSLIST` | Yes | Provides a cluster-level view of the "PROCESSLIST" table. | +| `CLUSTER_SLOW_QUERY` | Yes | Provides a cluster-level view of the "SLOW_QUERY" table. | +| `CLUSTER_STATEMENTS_SUMMARY` | Yes | TODO | +| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | Yes | +| `CLUSTER_SYSTEMINFO` | Yes | TODO | +| `COLLATIONS` | No | Provides a list of collations that the server supports. | +| `COLLATION_CHARACTER_SET_APPLICABILITY` | No | Explains which collations apply to which character sets. | +| `COLUMNS` | No | TODO | +| `COLUMN_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | +| `COLUMN_STATISTICS` | No | TODO | +| `DDL_JOBS` | Yes | TODO | +| `ENGINES` | No | TODO | +| `EVENTS` | No | Not implemented by TiDB. Returns zero rows. | +| `FILES` | No | Not implemented by TiDB. Returns zero rows. | +| `GLOBAL_STATUS` | No | Not implemented by TiDB. Returns zero rows. | +| `GLOBAL_VARIABLES` | No | Not implemented by TiDB. Returns zero rows. | +| `INSPECTION_RESULT` | Yes | TODO | +| `INSPECTION_RULES` | Yes | TODO | +| `INSPECTION_SUMMARY` | Yes | TODO | +| `KEY_COLUMN_USAGE` | No | TODO | +| `METRICS_SUMMARY` | Yes | TODO | +| `METRICS_SUMMARY_BY_LABEL` | Yes | TODO | +| `METRICS_TABLES` | Yes | TODO | +| `OPTIMIZER_TRACE` | No | Not implemented by TiDB. Returns zero rows. | +| `PARAMETERS` | No | Not implemented by TiDB. Returns zero rows. | +| `PARTITIONS` | No | Provides a list of table partitions. | +| `PLUGINS` | No | Not implemented by TiDB. Returns zero rows. | +| `PROCESSLIST` | No | Provides similar information to the command `SHOW PROCESSLIST`. | +| `PROFILING` | No | Not implemented by TiDB. Returns zero rows. | +| `REFERENTIAL_CONSTRAINTS` | No | Not implemented by TiDB. Returns zero rows. | +| `ROUTINES` | No | Not implemented by TiDB. Returns zero rows. | +| `SCHEMATA` | No | Provides similar information to `SHOW DATABASES`. | +| `SCHEMA_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | +| `SEQUENCES` | Yes | The TiDB implementation of sequences is based on MariaDB. | +| `SESSION_STATUS` | No | Not implemented by TiDB. Returns zero rows. | +| `SESSION_VARIABLES` | No | Provides similar functionality to the command `SHOW SESSION VARIABLES` | +| `SLOW_QUERY` | Yes | Provides information on slow queries on the current TiDB server. | +| `STATEMENTS_SUMMARY` | Yes | Similar to PFS statement summary in MySQL. | +| `STATEMENTS_SUMMARY_HISTORY` | Yes | Similar to PFS statement summary history in MySQL. | +| `STATISTICS` | No | Provides information on table indexes. | +| `TABLES` | No | Provides a list of tables that the current user has visibility of. Similar to `SHOW TABLES`. | +| `TABLESPACES` | No | Not implemented by TiDB. Returns zero rows. | +| `TABLE_CONSTRAINTS` | No | Provides information on primary keys, unique indexes and foreign keys. | +| `TABLE_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | +| `TIDB_HOT_REGIONS` | Yes | TODO | +| `TIDB_INDEXES` | Yes | TODO | +| `TIDB_SERVERS_INFO` | Yes | TODO | +| `TIFLASH_REPLICA` | Yes | TODO | +| `TIKV_REGION_PEERS` | Yes | TODO | +| `TIKV_REGION_STATUS` | Yes | TODO | +| `TIKV_STORE_STATUS` | Yes | TODO | +| `TRIGGERS` | No | Not implemented by TiDB. Returns zero rows. | +| `USER_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | +| `VIEWS` | No | Provides a list of views that the current user has visibility of. Similar to running `SHOW FULL TABLES WHERE table_type = 'VIEW'` | + ## Fully Supported Information Schema Tables @@ -1211,25 +1278,3 @@ Create Table: CREATE TABLE `SLOW_QUERY` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 1 row in set (0.00 sec) ``` - -## Unsupported Information Schema Tables - -The following `INFORMATION_SCHEMA` tables are present in TiDB, but will always return zero rows: - -* `COLUMN_PRIVILEGES` -* `EVENTS` -* `FILES` -* `GLOBAL_STATUS` -* `GLOBAL_VARIABLES` -* `OPTIMIZER_TRACE` -* `PARAMETERS` -* `PARTITIONS` -* `PLUGINS` -* `PROFILING` -* `REFERENTIAL_CONSTRAINTS` -* `ROUTINES` -* `SCHEMA_PRIVILEGES` -* `SESSION_STATUS` -* `TABLESPACES` -* `TABLE_PRIVILEGES` -* `TRIGGERS` From 2a4ca483284129a3bb842707305df31777d4f753 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Mon, 6 Jul 2020 13:37:33 -0600 Subject: [PATCH 02/14] Add missing items --- TOC.md | 83 +++++++------------ .../information-schema-character-sets.md | 0 ...rmation-schema-metrics-summary-by-label.md | 0 .../information-schema-sequences.md | 0 .../information-schema-table-storage-stats.md | 0 .../information-schema-tidb-servers-info.md | 0 6 files changed, 30 insertions(+), 53 deletions(-) create mode 100644 information-schema/information-schema-character-sets.md create mode 100644 information-schema/information-schema-metrics-summary-by-label.md create mode 100644 information-schema/information-schema-sequences.md create mode 100644 information-schema/information-schema-table-storage-stats.md create mode 100644 information-schema/information-schema-tidb-servers-info.md diff --git a/TOC.md b/TOC.md index 3e9da78b7040c..f6d818161853e 100644 --- a/TOC.md +++ b/TOC.md @@ -359,69 +359,46 @@ + System Tables + [`mysql`](/mysql-schema.md) + [`INFORMATION_SCHEMA`](/information-schema.md) - + [`ANALYZE_STATUS`](/information-schema/information-schema-analyze_status.md) - + [`CHARACTER_SETS`](/information-schema/information-schema-character_sets.md) - + [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster_config.md) - + [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster_hardware.md) - + [`CLUSTER_INFO`](/information-schema/information-schema-cluster_info.md) - + [`CLUSTER_LOAD`](/information-schema/information-schema-cluster_load.md) - + [`CLUSTER_LOG`](/information-schema/information-schema-cluster_log.md) - + [`CLUSTER_PROCESSLIST`](/information-schema/information-schema-cluster_processlist.md) - + [`CLUSTER_SLOW_QUERY`](/information-schema/information-schema-cluster_slow_query.md) - + [`CLUSTER_STATEMENTS_SUMMARY`](/information-schema/information-schema-cluster_statements_summary.md) - + [`CLUSTER_STATEMENTS_SUMMARY_HISTORY`](/information-schema/information-schema-cluster_statements_summary_history.md) - + [`CLUSTER_SYSTEMINFO`](/information-schema/information-schema-cluster_systeminfo.md) + + [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) + + [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) + + [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster-config.md) + + [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster-hardware.md) + + [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) + + [`CLUSTER_LOAD`](/information-schema/information-schema-cluster-load.md) + + [`CLUSTER_LOG`](/information-schema/information-schema-cluster-log.md) + + [`CLUSTER_SYSTEMINFO`](/information-schema/information-schema-cluster-systeminfo.md) + [`COLLATIONS`](/information-schema/information-schema-collations.md) - + [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation_character_set_applicability.md) + + [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) + [`COLUMNS`](/information-schema/information-schema-columns.md) - + [`COLUMN_PRIVILEGES`](/information-schema/information-schema-column_privileges.md) - + [`COLUMN_STATISTICS`](/information-schema/information-schema-column_statistics.md) - + [`DDL_JOBS`](/information-schema/information-schema-ddl_jobs.md) + + [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) + [`ENGINES`](/information-schema/information-schema-engines.md) - + [`EVENTS`](/information-schema/information-schema-events.md) - + [`FILES`](/information-schema/information-schema-files.md) - + [`GLOBAL_STATUS`](/information-schema/information-schema-global_status.md) - + [`GLOBAL_VARIABLES`](/information-schema/information-schema-global_variables.md) - + [`INSPECTION_RESULT`](/information-schema/information-schema-inspection_result.md) - + [`INSPECTION_RULES`](/information-schema/information-schema-inspection_rules.md) - + [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection_summary.md) - + [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key_column_usage.md) - + [`METRICS_SUMMARY`](/information-schema/information-schema-metrics_summary.md) - + [`METRICS_SUMMARY_BY_LABEL`](/information-schema/information-schema-metrics_summary_by_label.md) - + [`METRICS_TABLES`](/information-schema/information-schema-metrics_tables.md) - + [`OPTIMIZER_TRACE`](/information-schema/information-schema-optimizer_trace.md) - + [`PARAMETERS`](/information-schema/information-schema-parameters.md) + + [`INSPECTION_RESULT`](/information-schema/information-schema-inspection-result.md) + + [`INSPECTION_RULES`](/information-schema/information-schema-inspection-rules.md) + + [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) + + [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) + + [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) + + [`METRICS_SUMMARY_BY_LABEL`](/information-schema/information-schema-metrics-summary-by-label.md) + + [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) + [`PARTITIONS`](/information-schema/information-schema-partitions.md) - + [`PLUGINS`](/information-schema/information-schema-plugins.md) + [`PROCESSLIST`](/information-schema/information-schema-processlist.md) - + [`PROFILING`](/information-schema/information-schema-profiling.md) - + [`REFERENTIAL_CONSTRAINTS`](/information-schema/information-schema-referential_constraints.md) - + [`ROUTINES`](/information-schema/information-schema-routines.md) + [`SCHEMATA`](/information-schema/information-schema-schemata.md) - + [`SCHEMA_PRIVILEGES`](/information-schema/information-schema-schema_privileges.md) + [`SEQUENCES`](/information-schema/information-schema-sequences.md) - + [`SESSION_STATUS`](/information-schema/information-schema-session_status.md) - + [`SESSION_VARIABLES`](/information-schema/information-schema-session_variables.md) - + [`SLOW_QUERY`](/information-schema/information-schema-slow_query.md) - + [`STATEMENTS_SUMMARY`](/information-schema/information-schema-statements_summary.md) - + [`STATEMENTS_SUMMARY_HISTORY`](/information-schema/information-schema-statements_summary_history.md) + + [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) + + [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) + [`STATISTICS`](/information-schema/information-schema-statistics.md) + [`TABLES`](/information-schema/information-schema-tables.md) - + [`TABLESPACES`](/information-schema/information-schema-tablespaces.md) - + [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table_constraints.md) - + [`TABLE_PRIVILEGES`](/information-schema/information-schema-table_privileges.md) - + [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table_storage_stats.md) - + [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb_hot_regions.md) - + [`TIDB_INDEXES`](/information-schema/information-schema-tidb_indexes.md) - + [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb_servers_info.md) - + [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash_replica.md) - + [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv_region_peers.md) - + [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv_region_status.md) - + [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv_store_status.md) - + [`TRIGGERS`](/information-schema/information-schema-triggers.md) - + [`USER_PRIVILEGES`](/information-schema/information-schema-user_privileges.md) + + [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) + + [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) + + [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb_hot-regions.md) + + [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) + + [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) + + [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) + + [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) + + [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) + + [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store_status.md) + + [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) + [`VIEWS`](/information-schema/information-schema-views.md) - + [`metrics_schema`](/metrics-schema.md) + + [`METRICS_SCHEMA`](/metrics-schema.md) + UI + TiDB Dashboard + [Overview](/dashboard/dashboard-intro.md) diff --git a/information-schema/information-schema-character-sets.md b/information-schema/information-schema-character-sets.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/information-schema/information-schema-metrics-summary-by-label.md b/information-schema/information-schema-metrics-summary-by-label.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/information-schema/information-schema-sequences.md b/information-schema/information-schema-sequences.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/information-schema/information-schema-table-storage-stats.md b/information-schema/information-schema-table-storage-stats.md new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/information-schema/information-schema-tidb-servers-info.md b/information-schema/information-schema-tidb-servers-info.md new file mode 100644 index 0000000000000..e69de29bb2d1d From d2e65889c4e6973a0409a263e94887befbb05386 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Mon, 6 Jul 2020 14:40:36 -0600 Subject: [PATCH 03/14] WIP --- TOC.md | 8 +- information-schema.md | 87 +++++++------- .../information-schema-analyze-status.md | 2 +- .../information-schema-character-sets.md | 47 ++++++++ .../information-schema-cluster-config.md | 4 +- .../information-schema-cluster-hardware.md | 2 +- .../information-schema-cluster-info.md | 2 +- .../information-schema-cluster-load.md | 2 +- .../information-schema-cluster-log.md | 2 +- .../information-schema-cluster-systeminfo.md | 2 +- ...a-collation-character-set-applicability.md | 6 +- .../information-schema-collations.md | 4 +- .../information-schema-columns.md | 6 +- .../information-schema-ddl-jobs.md | 67 ++++++++++- .../information-schema-engines.md | 4 +- .../information-schema-inspection-result.md | 9 +- .../information-schema-inspection-rules.md | 55 ++++++++- .../information-schema-inspection-summary.md | 5 +- .../information-schema-key-column-usage.md | 8 +- ...rmation-schema-metrics-summary-by-label.md | 0 .../information-schema-metrics-summary.md | 34 +++--- .../information-schema-metrics-tables.md | 47 +++++++- .../information-schema-partitions.md | 106 +++++++++++++++++- .../information-schema-processlist.md | 11 +- .../information-schema-schemata.md | 4 +- .../information-schema-sequences.md | 66 +++++++++++ .../information-schema-session-variables.md | 4 +- .../information-schema-slow-query.md | 4 +- .../information-schema-statistics.md | 6 +- .../information-schema-table-constraints.md | 6 +- .../information-schema-table-storage-stats.md | 53 +++++++++ .../information-schema-tables.md | 4 +- .../information-schema-tidb-hot-regions.md | 4 +- .../information-schema-tidb-indexes.md | 20 ++-- .../information-schema-tidb-servers-info.md | 51 +++++++++ .../information-schema-tiflash-replica.md | 30 ++++- .../information-schema-tikv-region-peers.md | 69 +++--------- .../information-schema-tikv-region-status.md | 37 +----- .../information-schema-tikv-store-status.md | 43 +------ .../information-schema-user-privileges.md | 48 +++++++- .../information-schema-views.md | 4 +- .../system-table-character-sets.md | 48 -------- metrics-schema.md | 92 ++++++++++++++- mysql-schema.md | 8 +- 44 files changed, 804 insertions(+), 317 deletions(-) delete mode 100644 information-schema/information-schema-metrics-summary-by-label.md delete mode 100644 information-schema/system-table-character-sets.md diff --git a/TOC.md b/TOC.md index f6d818161853e..d25e47016be68 100644 --- a/TOC.md +++ b/TOC.md @@ -358,7 +358,8 @@ + [Character Set and Collation](/character-set-and-collation.md) + System Tables + [`mysql`](/mysql-schema.md) - + [`INFORMATION_SCHEMA`](/information-schema.md) + + `INFORMATION_SCHEMA` + + [Overview](/information-schema.md) + [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) + [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) + [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster-config.md) @@ -377,7 +378,6 @@ + [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) + [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) + [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) - + [`METRICS_SUMMARY_BY_LABEL`](/information-schema/information-schema-metrics-summary-by-label.md) + [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) + [`PARTITIONS`](/information-schema/information-schema-partitions.md) + [`PROCESSLIST`](/information-schema/information-schema-processlist.md) @@ -389,13 +389,13 @@ + [`TABLES`](/information-schema/information-schema-tables.md) + [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) + [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) - + [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb_hot-regions.md) + + [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) + [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) + [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) + [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) + [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) + [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) - + [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store_status.md) + + [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) + [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) + [`VIEWS`](/information-schema/information-schema-views.md) + [`METRICS_SCHEMA`](/metrics-schema.md) diff --git a/information-schema.md b/information-schema.md index a6d28e2bd44f4..c902036372f6b 100644 --- a/information-schema.md +++ b/information-schema.md @@ -2,7 +2,7 @@ title: Information Schema summary: TiDB implements the ANSI-standard information_schema for viewing system metadata. category: reference -aliases: ['/docs/dev/system-tables/system-table-information-schema/','/docs/dev/reference/system-databases/information-schema/'] +aliases: ['/docs/dev/information-schema/information-schema-information-schema/','/docs/dev/reference/system-databases/information-schema/'] --- # Information Schema @@ -13,64 +13,65 @@ Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefi | Table Name | TiDB Extension | Description | |-----------------------------------------------------------------------------------------|----------------|-------------| -| [`ANALYZE_STATUS`](#analyze_status-table) | Yes | Provides information about tasks to collect statistics. | -| [`CHARACTER_SETS`](#character_sets-table) | No | Provides a list of character sets the server supports. | -| [`CLUSTER_CONFIG`](/system-tables/system-table-cluster-config.md) | Yes | Provides details about configuration settings for the entire TiDB cluster. | -| [`CLUSTER_HARDWARE`](/system-tables/system-table-cluster-info.md) | Yes | Provides details on the underlying physical hardware discovered on each TiDB component. | -| [`CLUSTER_INFO`](/system-tables/system-table-cluster-info.md) | Yes | Provides details on the current cluster topology. | -| [`CLUSTER_LOAD`](/system-tables/system-table-cluster-load.md) | Yes | Provides current load information for TiDB servers in the cluster. | -| [`CLUSTER_LOG`](/system-tables/system-table-cluster-log.md) | Yes | Provides a log for the entire TiDB cluster | -| `CLUSTER_PROCESSLIST` | Yes | Provides a cluster-level view of the "PROCESSLIST" table. | -| `CLUSTER_SLOW_QUERY` | Yes | Provides a cluster-level view of the "SLOW_QUERY" table. | -| `CLUSTER_STATEMENTS_SUMMARY` | Yes | Provides a cluster-level view of the "STATEMENTS_SUMMARY" table. | -| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | Yes | Provides a cluster-level view of the "CLUSTER_STATEMENTS_SUMMARY_HISTORY" table. | -| [`CLUSTER_SYSTEMINFO`](/system-tables/system-table-cluster-systeminfo.md) | Yes | Provides details about kernel parameter configuration for servers in the cluster. | -| [`COLLATIONS`](#collations-table) | No | Provides a list of collations that the server supports. | -| [`COLLATION_CHARACTER_SET_APPLICABILITY`](#collation_character_set_applicability-table) | No | Explains which collations apply to which character sets. | -| [`COLUMNS`](#columns-table) | No | Provides a list of columns for all tables. | +| [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) | Yes | Provides information about tasks to collect statistics. | +| [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) | No | Provides a list of character sets the server supports. | +| [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster-config.md) | Yes | Provides details about configuration settings for the entire TiDB cluster. | +| [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster-info.md) | Yes | Provides details on the underlying physical hardware discovered on each TiDB component. | +| [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) | Yes | Provides details on the current cluster topology. | +| [`CLUSTER_LOAD`](/information-schema/information-schema-cluster-load.md) | Yes | Provides current load information for TiDB servers in the cluster. | +| [`CLUSTER_LOG`](/information-schema/information-schema-cluster-log.md) | Yes | Provides a log for the entire TiDB cluster | +| `CLUSTER_PROCESSLIST` | Yes | Provides a cluster-level view of the `PROCESSLIST` table. | +| `CLUSTER_SLOW_QUERY` | Yes | Provides a cluster-level view of the `SLOW_QUERY` table. | +| `CLUSTER_STATEMENTS_SUMMARY` | Yes | Provides a cluster-level view of the `STATEMENTS_SUMMARY` table. | +| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | Yes | Provides a cluster-level view of the `CLUSTER_STATEMENTS_SUMMARY_HISTORY` table. | +| [`CLUSTER_SYSTEMINFO`](/information-schema/information-schema-cluster-systeminfo.md) | Yes | Provides details about kernel parameter configuration for servers in the cluster. | +| [`COLLATIONS`](/information-schema/information-schema-collations.md) | No | Provides a list of collations that the server supports. | +| [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) | No | Explains which collations apply to which character sets. | +| [`COLUMNS`](/information-schema/information-schema-columns.md) | No | Provides a list of columns for all tables. | | `COLUMN_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | | `COLUMN_STATISTICS` | No | Not implemented by TiDB. Returns zero rows. | -| [`DDL_JOBS`](#todo) | Yes | Provides similar output to `ADMIN SHOW DDL JOBS` | -| [`ENGINES`](#engines-table) | No | Provides a list of supported storage engines. | +| [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) | Yes | Provides similar output to `ADMIN SHOW DDL JOBS` | +| [`ENGINES`](/information-schema/information-schema-engines.md) | No | Provides a list of supported storage engines. | | `EVENTS` | No | Not implemented by TiDB. Returns zero rows. | | `FILES` | No | Not implemented by TiDB. Returns zero rows. | | `GLOBAL_STATUS` | No | Not implemented by TiDB. Returns zero rows. | | `GLOBAL_VARIABLES` | No | Not implemented by TiDB. Returns zero rows. | -| [`INSPECTION_RESULT`](/system-tables/system-table-cluster-inspection-result.md) | Yes | Triggers internal diagnostics checks. | -| [`INSPECTION_RULES`](#todo) | Yes | TODO | -| [`INSPECTION_SUMMARY`](/system-tables/system-table-cluster-inspection-summary.md) | Yes | TODO | -| [`KEY_COLUMN_USAGE`](#key_column_usage_table) | No | TODO | -| [`METRICS_SUMMARY`](/system-tables/system-table-cluster-metrics-summary.md) | Yes | TODO | -| [`METRICS_SUMMARY_BY_LABEL`](#todo) | Yes | TODO | -| [`METRICS_TABLES`](/system-tables/system-table-cluster-metrics-tables.md) | Yes | TODO | +| [`INSPECTION_RESULT`](/information-schema/information-schema-inspection-result.md) | Yes | Triggers internal diagnostics checks. | +| [`INSPECTION_RULES`](/information-schema/information-schema-inspection-rules.md) | Yes | A list of internal diagnostic checks performed. | +| [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) | Yes | A summarized report of important monitoring metrics. | +| [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) | No | Describes the key constraints of the columns, such as the primary key constraint. | +| [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) | Yes | A summary of metrics extracted from Prometheus. | +| `METRICS_SUMMARY_BY_LABEL` | Yes | See `METRICS_SUMAMARY` table. | +| [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) | Yes | Provides the PromQL definitions for tables in `METRICS_SCHEMA`. | | `OPTIMIZER_TRACE` | No | Not implemented by TiDB. Returns zero rows. | | `PARAMETERS` | No | Not implemented by TiDB. Returns zero rows. | -| [`PARTITIONS`](#partitions-table) | No | Provides a list of table partitions. | +| [`PARTITIONS`](/information-schema/information-schema-partitions.md) | No | Provides a list of table partitions. | | `PLUGINS` | No | Not implemented by TiDB. Returns zero rows. | -| [`PROCESSLIST`](#processlist-table) | No | Provides similar information to the command `SHOW PROCESSLIST`. | +| [`PROCESSLIST`](/information-schema/information-schema-processlist.md) | No | Provides similar information to the command `SHOW PROCESSLIST`. | | `PROFILING` | No | Not implemented by TiDB. Returns zero rows. | | `REFERENTIAL_CONSTRAINTS` | No | Not implemented by TiDB. Returns zero rows. | | `ROUTINES` | No | Not implemented by TiDB. Returns zero rows. | -| [`SCHEMATA`](#schemata-table) | No | Provides similar information to `SHOW DATABASES`. | +| [`SCHEMATA`](/information-schema/information-schema-schemata.md) | No | Provides similar information to `SHOW DATABASES`. | | `SCHEMA_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | -| [`SEQUENCES`](#sequences-table) | Yes | The TiDB implementation of sequences is based on MariaDB. | +| [`SEQUENCES`](/information-schema/information-schema-sequences.md) | Yes | The TiDB implementation of sequences is based on MariaDB. | | `SESSION_STATUS` | No | Not implemented by TiDB. Returns zero rows. | -| [`SESSION_VARIABLES`](#session_variables-table) | No | Provides similar functionality to the command `SHOW SESSION VARIABLES` | -| [`SLOW_QUERY`](#todo) | Yes | Provides information on slow queries on the current TiDB server. | +| [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) | No | Provides similar functionality to the command `SHOW SESSION VARIABLES` | +| [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) | Yes | Provides information on slow queries on the current TiDB server. | | [`STATEMENTS_SUMMARY`](/statement-summary-tables.md) | Yes | Similar to performance_schema statement summary in MySQL. | | [`STATEMENTS_SUMMARY_HISTORY`](/statement-summary-tables.md) | Yes | Similar to performance_schema statement summary history in MySQL. | -| [`STATISTICS`](#statistics-table) | No | Provides information on table indexes. | -| [`TABLES`](#tables-table) | No | Provides a list of tables that the current user has visibility of. Similar to `SHOW TABLES`. | +| [`STATISTICS`](/information-schema/information-schema-statistics.md) | No | Provides information on table indexes. | +| [`TABLES`](/information-schema/information-schema-tables.md) | No | Provides a list of tables that the current user has visibility of. Similar to `SHOW TABLES`. | | `TABLESPACES` | No | Not implemented by TiDB. Returns zero rows. | -| [`TABLE_CONSTRAINTS`](#table_constraints-table) | No | Provides information on primary keys, unique indexes and foreign keys. | +| [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) | No | Provides information on primary keys, unique indexes and foreign keys. | | `TABLE_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | -| [`TIDB_HOT_REGIONS`](#todo) | Yes | TODO | -| [`TIDB_INDEXES`](#todo) | Yes | TODO | -| [`TIDB_SERVERS_INFO`](#todo) | Yes | TODO | -| [`TIFLASH_REPLICA`](#todo) | Yes | TODO | -| [`TIKV_REGION_PEERS`](#todo) | Yes | TODO | -| [`TIKV_REGION_STATUS`](#todo) | Yes | TODO | -| [`TIKV_STORE_STATUS`](#todo) | Yes | TODO | +| [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) | Yes | Provides details about table sizes in storage. | +| [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) | Yes | Provides statistics about which regions are hot. | +| [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) | Yes | Provides index information about TiDB tables. | +| [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) | Yes | Provides a list of TiDB servers (i.e. tidb-server component) | +| [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) | Yes | Provides details about TiFlash replicas. | +| [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) | Yes | Provides details about where regions are stored. | +| [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) | Yes | Provides statistics about regions. | +| [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) | Yes | Provides basic information about TiKV servers. | | `TRIGGERS` | No | Not implemented by TiDB. Returns zero rows. | -| `USER_PRIVILEGES` | No | TODO Need to check - it looks like it might be implemented?? | -| [`VIEWS`](#views-table) | No | Provides a list of views that the current user has visibility of. Similar to running `SHOW FULL TABLES WHERE table_type = 'VIEW'` | +| [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) | No | Summarizes the privileges associated with the current user. | +| [`VIEWS`](/information-schema/information-schema-views.md) | No | Provides a list of views that the current user has visibility of. Similar to running `SHOW FULL TABLES WHERE table_type = 'VIEW'` | diff --git a/information-schema/information-schema-analyze-status.md b/information-schema/information-schema-analyze-status.md index 6403203146124..6cff99b5df5d9 100644 --- a/information-schema/information-schema-analyze-status.md +++ b/information-schema/information-schema-analyze-status.md @@ -11,7 +11,7 @@ The `ANALYZE_STATUS` table provides information about the running tasks that col {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC analyze_status; ``` diff --git a/information-schema/information-schema-character-sets.md b/information-schema/information-schema-character-sets.md index e69de29bb2d1d..b2faf21ae6387 100644 --- a/information-schema/information-schema-character-sets.md +++ b/information-schema/information-schema-character-sets.md @@ -0,0 +1,47 @@ +--- +title: CHARACTER_SETS +summary: Learn the `CHARACTER_SETS` information_schema table. +category: reference +--- + +# CHARACTER_SETS + +The `CHARACTER_SETS` table provides information about [character sets](/character-set-and-collation.md). Currently, TiDB only supports some of the character sets. + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC character_sets; +``` + +``` ++----------------------+-------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++----------------------+-------------+------+------+---------+-------+ +| CHARACTER_SET_NAME | varchar(32) | YES | | NULL | | +| DEFAULT_COLLATE_NAME | varchar(32) | YES | | NULL | | +| DESCRIPTION | varchar(60) | YES | | NULL | | +| MAXLEN | bigint(3) | YES | | NULL | | ++----------------------+-------------+------+------+---------+-------+ +4 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +SELECT * FROM `character_sets`; +``` + +``` ++--------------------+----------------------+---------------+--------+ +| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN | ++--------------------+----------------------+---------------+--------+ +| utf8 | utf8_bin | UTF-8 Unicode | 3 | +| utf8mb4 | utf8mb4_bin | UTF-8 Unicode | 4 | +| ascii | ascii_bin | US ASCII | 1 | +| latin1 | latin1_bin | Latin1 | 1 | +| binary | binary | binary | 1 | ++--------------------+----------------------+---------------+--------+ +5 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-cluster-config.md b/information-schema/information-schema-cluster-config.md index 5666cfa677649..d00f3da721125 100644 --- a/information-schema/information-schema-cluster-config.md +++ b/information-schema/information-schema-cluster-config.md @@ -7,12 +7,12 @@ aliases: ['/docs/dev/system-tables/system-table-cluster-config/','/docs/dev/refe # CLUSTER_CONFIG -You can use the `CLUSTER_CONFIG` cluster configuration table to get the current configuration of all TiDB/PD/TiKV instances in the cluster. For TiDB versions earlier than 4.0, you need to access the HTTP API of each instance one by one to collect all component configurations. +You can use the `CLUSTER_CONFIG` cluster configuration table to get the current configuration of all server components in the cluster. This simplifies the usage over earlier releases of TiDB, where obtaining similar information would require accessing the HTTP API end points of each instance. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC cluster_config; ``` diff --git a/information-schema/information-schema-cluster-hardware.md b/information-schema/information-schema-cluster-hardware.md index f09d80e1cc42f..41f079373c8b7 100644 --- a/information-schema/information-schema-cluster-hardware.md +++ b/information-schema/information-schema-cluster-hardware.md @@ -12,7 +12,7 @@ The `CLUSTER_HARDWARE` hardware system table provides the hardware information o {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC cluster_hardware; ``` diff --git a/information-schema/information-schema-cluster-info.md b/information-schema/information-schema-cluster-info.md index 28913cdcec703..3c07a75c63a03 100644 --- a/information-schema/information-schema-cluster-info.md +++ b/information-schema/information-schema-cluster-info.md @@ -12,7 +12,7 @@ The `CLUSTER_INFO` cluster topology table provides the current topology informat {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; desc cluster_info; ``` diff --git a/information-schema/information-schema-cluster-load.md b/information-schema/information-schema-cluster-load.md index 9e4ade96695d1..749743188823f 100644 --- a/information-schema/information-schema-cluster-load.md +++ b/information-schema/information-schema-cluster-load.md @@ -12,7 +12,7 @@ The `CLUSTER_LOAD` cluster load table provides the current load information of t {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC cluster_load; ``` diff --git a/information-schema/information-schema-cluster-log.md b/information-schema/information-schema-cluster-log.md index c3f7de6470f11..14086fa0c21c6 100644 --- a/information-schema/information-schema-cluster-log.md +++ b/information-schema/information-schema-cluster-log.md @@ -14,7 +14,7 @@ To get the logs of the TiDB cluster before v4.0, you need to log in to each inst {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC cluster_log; ``` diff --git a/information-schema/information-schema-cluster-systeminfo.md b/information-schema/information-schema-cluster-systeminfo.md index a6770e76393a5..401ca6e966993 100644 --- a/information-schema/information-schema-cluster-systeminfo.md +++ b/information-schema/information-schema-cluster-systeminfo.md @@ -12,7 +12,7 @@ You can use the `CLUSTER_SYSTEMINFO` kernel parameter table to query the kernel {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC cluster_systeminfo; ``` diff --git a/information-schema/information-schema-collation-character-set-applicability.md b/information-schema/information-schema-collation-character-set-applicability.md index c6a391601a52b..98b58d2863aca 100644 --- a/information-schema/information-schema-collation-character-set-applicability.md +++ b/information-schema/information-schema-collation-character-set-applicability.md @@ -4,14 +4,14 @@ summary: Learn the `COLLATION_CHARACTER_SET_APPLICABILITY` information_schema ta category: reference --- -### COLLATION_CHARACTER_SET_APPLICABILITY +# COLLATION_CHARACTER_SET_APPLICABILITY -The `COLLATION_CHARACTER_SET_APPLICABILITY` table maps collations to the applicable character set name. Similar to the `COLLATIONS` table, it is included only for compatibility with MySQL: +The `COLLATION_CHARACTER_SET_APPLICABILITY` table maps collations to the applicable character set name. Similar to the `COLLATIONS` table, it is included only for compatibility with MySQL. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC collation_character_set_applicability; ``` diff --git a/information-schema/information-schema-collations.md b/information-schema/information-schema-collations.md index fbc58de708d74..4e14c18a5aa6f 100644 --- a/information-schema/information-schema-collations.md +++ b/information-schema/information-schema-collations.md @@ -6,12 +6,12 @@ category: reference # COLLATIONS -The `COLLATIONS` table provides a list of collations that correspond to character sets in the `CHARACTER_SETS` table. Currently this table is included only for compatibility with MySQL, as TiDB only supports binary collation: +The `COLLATIONS` table provides a list of collations that correspond to character sets in the `CHARACTER_SETS` table. Currently this table is included only for compatibility with MySQL. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC collations; ``` diff --git a/information-schema/information-schema-columns.md b/information-schema/information-schema-columns.md index f94d0a041137c..7276faf7571b6 100644 --- a/information-schema/information-schema-columns.md +++ b/information-schema/information-schema-columns.md @@ -4,14 +4,14 @@ summary: Learn the `COLUMNS` information_schema table. category: reference --- -### COLUMNS +# COLUMNS -The `COLUMNS` table provides detailed information about columns in tables: +The `COLUMNS` table provides detailed information about columns in tables. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC columns; ``` diff --git a/information-schema/information-schema-ddl-jobs.md b/information-schema/information-schema-ddl-jobs.md index 3323ece7d97ea..9c5f88258b606 100644 --- a/information-schema/information-schema-ddl-jobs.md +++ b/information-schema/information-schema-ddl-jobs.md @@ -7,13 +7,12 @@ category: reference # DDL_JOBS - - +The `DDL_JOBS` table provides an `INFORMATION_SCHEMA` interface to the `ADMIN SHOW DDL JOBS` command. It provides both the current status and a short history of DDL operations across the TiDB cluster. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC ddl_jobs; ``` @@ -36,3 +35,65 @@ DESC ddl_jobs; +--------------+-------------+------+------+---------+-------+ 12 rows in set (0.00 sec) ``` + +{{< copyable "sql" >}} + +```sql +SELECT * FROM ddl_jobs LIMIT 3\G +``` + +```sql +*************************** 1. row *************************** + JOB_ID: 44 + DB_NAME: mysql + TABLE_NAME: opt_rule_blacklist + JOB_TYPE: create table +SCHEMA_STATE: public + SCHEMA_ID: 3 + TABLE_ID: 43 + ROW_COUNT: 0 + START_TIME: 2020-07-06 15:24:27 + END_TIME: 2020-07-06 15:24:27 + STATE: synced + QUERY: CREATE TABLE IF NOT EXISTS mysql.opt_rule_blacklist ( + name char(100) NOT NULL + ); +*************************** 2. row *************************** + JOB_ID: 42 + DB_NAME: mysql + TABLE_NAME: expr_pushdown_blacklist + JOB_TYPE: create table +SCHEMA_STATE: public + SCHEMA_ID: 3 + TABLE_ID: 41 + ROW_COUNT: 0 + START_TIME: 2020-07-06 15:24:27 + END_TIME: 2020-07-06 15:24:27 + STATE: synced + QUERY: CREATE TABLE IF NOT EXISTS mysql.expr_pushdown_blacklist ( + name char(100) NOT NULL, + store_type char(100) NOT NULL DEFAULT 'tikv,tiflash,tidb', + reason varchar(200) + ); +*************************** 3. row *************************** + JOB_ID: 40 + DB_NAME: mysql + TABLE_NAME: stats_top_n + JOB_TYPE: create table +SCHEMA_STATE: public + SCHEMA_ID: 3 + TABLE_ID: 39 + ROW_COUNT: 0 + START_TIME: 2020-07-06 15:24:26 + END_TIME: 2020-07-06 15:24:27 + STATE: synced + QUERY: CREATE TABLE if not exists mysql.stats_top_n ( + table_id bigint(64) NOT NULL, + is_index tinyint(2) NOT NULL, + hist_id bigint(64) NOT NULL, + value longblob, + count bigint(64) UNSIGNED NOT NULL, + index tbl(table_id, is_index, hist_id) + ); +3 rows in set (0.01 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-engines.md b/information-schema/information-schema-engines.md index 4e9532fd54d42..71062436b21fd 100644 --- a/information-schema/information-schema-engines.md +++ b/information-schema/information-schema-engines.md @@ -4,7 +4,7 @@ summary: Learn the `ENGINES` information_schema table. category: reference --- -### ENGINES +# ENGINES The `ENGINES` table provides information about storage engines. For compatibility, TiDB will always describe InnoDB as the only supported engine. In addition, other column values in the `ENGINES` table are also fixed values. @@ -12,7 +12,7 @@ The `ENGINES` table provides information about storage engines. For compatibilit {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC engines; ``` diff --git a/information-schema/information-schema-inspection-result.md b/information-schema/information-schema-inspection-result.md index 235522ba9ecd8..2eb91c4bd2ad7 100644 --- a/information-schema/information-schema-inspection-result.md +++ b/information-schema/information-schema-inspection-result.md @@ -16,7 +16,8 @@ The structure of the `information_schema.inspection_result` diagnostic result ta {{< copyable "sql" >}} ```sql -desc information_schema.inspection_result; +USE information_schema; +DESC inspection_result; ``` ```sql @@ -60,7 +61,7 @@ Diagnose issues currently existing in the cluster. {{< copyable "sql" >}} ```sql -select * from information_schema.inspection_result\G +SELECT * FROM information_schema.inspection_result\G ``` ```sql @@ -235,7 +236,7 @@ The `version` diagnostic rule checks whether the version hash of the same compon {{< copyable "sql" >}} ```sql -select * from information_schema.inspection_result where rule='version'\G +SELECT * FROM information_schema.inspection_result WHERE rule='version'\G ``` ```sql @@ -247,7 +248,7 @@ INSTANCE | VALUE | inconsistent REFERENCE | consistent SEVERITY | critical -DETAILS | the cluster has 2 different tidb versions, execute the sql to see more detail: select * from information_schema.cluster_info where type='tidb' +DETAILS | the cluster has 2 different tidb versions, execute the sql to see more detail: SELECT * FROM information_schema.cluster_info WHERE type='tidb' ``` ### `critical-error` diagnostic rule diff --git a/information-schema/information-schema-inspection-rules.md b/information-schema/information-schema-inspection-rules.md index 8ef28f7a6ea39..68acb50ac79a3 100644 --- a/information-schema/information-schema-inspection-rules.md +++ b/information-schema/information-schema-inspection-rules.md @@ -1,5 +1,56 @@ --- -title: XXX -summary: Learn the `XXX` information_schema table. +title: INSPECTION_RULES +summary: Learn the `INSPECTION_RULES` information_schema table. category: reference --- + +# INSPECTION_RULES + +The `INSPECTION_RULES` table provides information about which diagnostic tests are run in an inspection result. See [inspection result](/information-schema/information-schema/inspection-result.md) for example usage. + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC inspection_rules; +``` + +``` ++---------+--------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+--------------+------+------+---------+-------+ +| NAME | varchar(64) | YES | | NULL | | +| TYPE | varchar(64) | YES | | NULL | | +| COMMENT | varchar(256) | YES | | NULL | | ++---------+--------------+------+------+---------+-------+ +3 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +SELECT * FROM inspection_rules; +``` + +``` ++-----------------+------------+---------+ +| NAME | TYPE | COMMENT | ++-----------------+------------+---------+ +| config | inspection | | +| version | inspection | | +| node-load | inspection | | +| critical-error | inspection | | +| threshold-check | inspection | | +| ddl | summary | | +| gc | summary | | +| pd | summary | | +| query-summary | summary | | +| raftstore | summary | | +| read-link | summary | | +| rocksdb | summary | | +| stats | summary | | +| wait-events | summary | | +| write-link | summary | | ++-----------------+------------+---------+ +15 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-inspection-summary.md b/information-schema/information-schema-inspection-summary.md index 17c9978df3bca..5b1fd165d0aee 100644 --- a/information-schema/information-schema-inspection-summary.md +++ b/information-schema/information-schema-inspection-summary.md @@ -14,7 +14,8 @@ The structure of the `information_schema.inspection_summary` inspection summary {{< copyable "sql" >}} ```sql -desc information_schema.inspection_summary; +USE information_schema; +DESC inspection_summary; ``` ```sql @@ -31,7 +32,7 @@ desc information_schema.inspection_summary; | MAX_VALUE | double(22,6) | YES | | NULL | | | COMMENT | varchar(256) | YES | | NULL | | +--------------+--------------+------+------+---------+-------+ -9 rows in set +9 rows in set (0.00 sec) ``` Field description: diff --git a/information-schema/information-schema-key-column-usage.md b/information-schema/information-schema-key-column-usage.md index 5014ba232f857..ffcf5e37237e8 100644 --- a/information-schema/information-schema-key-column-usage.md +++ b/information-schema/information-schema-key-column-usage.md @@ -7,15 +7,13 @@ category: reference # KEY_COLUMN_USAGE -The `KEY_COLUMN_USAGE` table describes the key constraints of the columns, such as the primary key constraint: - +The `KEY_COLUMN_USAGE` table describes the key constraints of the columns, such as the primary key constraint. {{< copyable "sql" >}} - ```sql -use information_schema; -desc key_column_usage; +USE information_schema; +DESC key_column_usage; ``` ``` diff --git a/information-schema/information-schema-metrics-summary-by-label.md b/information-schema/information-schema-metrics-summary-by-label.md deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/information-schema/information-schema-metrics-summary.md b/information-schema/information-schema-metrics-summary.md index a7314e766aa92..da9e85de76f67 100644 --- a/information-schema/information-schema-metrics-summary.md +++ b/information-schema/information-schema-metrics-summary.md @@ -17,7 +17,8 @@ The two tables summarize all monitoring data for you to check each monitoring me {{< copyable "sql" >}} ```sql -desc information_schema.metrics_summary; +USE information_schema; +DESC metrics_summary; ``` ```sql @@ -32,6 +33,7 @@ desc information_schema.metrics_summary; | MAX_VALUE | double(22,6) | YES | | NULL | | | COMMENT | varchar(256) | YES | | NULL | | +--------------+--------------+------+------+---------+-------+ +7 rows in set (0.00 sec) ``` Field description: @@ -50,13 +52,13 @@ To query the three groups of monitoring items with the highest average time cons {{< copyable "sql" >}} ```sql -select /*+ time_range('2020-03-08 13:23:00','2020-03-08 13:33:00') */ * -from information_schema.metrics_summary -where metrics_name like 'tidb%duration' - and avg_value > 0 - and quantile = 0.99 -order by avg_value desc -limit 3\G +SELECT /*+ time_range('2020-03-08 13:23:00','2020-03-08 13:33:00') */ * +FROM information_schema.metrics_summary +WHERE metrics_name LIKE 'tidb%duration' + AND avg_value > 0 + AND quantile = 0.99 +ORDER BY avg_value DESC +LIMIT 3\G ``` ```sql @@ -91,13 +93,13 @@ Similarly, the following example queries the `metrics_summary_by_label` monitori {{< copyable "sql" >}} ```sql -select /*+ time_range('2020-03-08 13:23:00','2020-03-08 13:33:00') */ * -from information_schema.metrics_summary_by_label -where metrics_name like 'tidb%duration' - and avg_value > 0 - and quantile = 0.99 -order by avg_value desc -limit 10\G +SELECT /*+ time_range('2020-03-08 13:23:00','2020-03-08 13:33:00') */ * +FROM information_schema.metrics_summary_by_label +WHERE metrics_name LIKE 'tidb%duration' + AND avg_value > 0 + AND quantile = 0.99 +ORDER BY avg_value DESC +LIMIT 10\G ``` ```sql @@ -158,7 +160,7 @@ JOIN (SELECT /*+ time_range("2020-03-03 17:18:00", "2020-03-03 17:21:00")*/ * FROM information_schema.metrics_summary ) t2 ON t1.metrics_name = t2.metrics_name -ORDER BY ratio DESC limit 10; +ORDER BY ratio DESC LIMIT 10; ``` ```sql diff --git a/information-schema/information-schema-metrics-tables.md b/information-schema/information-schema-metrics-tables.md index 42a8e86f8c5a2..4fdafd87b36ab 100644 --- a/information-schema/information-schema-metrics-tables.md +++ b/information-schema/information-schema-metrics-tables.md @@ -7,12 +7,13 @@ aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/refe # METRICS_TABLES -The `INFORMATION_SCHEMA.METRICS_TABLES` table provides information of all monitoring tables in the [metrics_schema](/system-tables/system-table-metrics-schema.md) database. +The `METRICS_TABLES` table provides the PromQL (Prometheus Query Language) definition for each of the views in the [metrics_schema](/metrics-schema.md) database. {{< copyable "sql" >}} ```sql -desc information_schema.metrics_tables; +USE information_schema; +DESC metrics_tables; ``` ```sql @@ -34,3 +35,45 @@ Field description: * `LABELS`: The label for the monitoring item. Each label corresponds to a column in the monitoring table. If the SQL statement contains the filter of the corresponding column, the corresponding `PromQL` changes accordingly. * `QUANTILE`: The percentile. For monitoring data of the histogram type, a default percentile is specified. If the value of this field is `0`, it means that the monitoring item corresponding to the monitoring table is not a histogram. * `COMMENT`: The comment about the monitoring table. + + + +{{< copyable "sql" >}} + +```sql +SELECT * FROM metrics_tables LIMIT 5\G +``` + +```sql +*************************** 1. row *************************** +TABLE_NAME: abnormal_stores + PROMQL: sum(pd_cluster_status{ type=~"store_disconnected_count|store_unhealth_count|store_low_space_count|store_down_count|store_offline_count|store_tombstone_count"}) + LABELS: instance,type + QUANTILE: 0 + COMMENT: +*************************** 2. row *************************** +TABLE_NAME: etcd_disk_wal_fsync_rate + PROMQL: delta(etcd_disk_wal_fsync_duration_seconds_count{$LABEL_CONDITIONS}[$RANGE_DURATION]) + LABELS: instance + QUANTILE: 0 + COMMENT: The rate of writing WAL into the persistent storage +*************************** 3. row *************************** +TABLE_NAME: etcd_wal_fsync_duration + PROMQL: histogram_quantile($QUANTILE, sum(rate(etcd_disk_wal_fsync_duration_seconds_bucket{$LABEL_CONDITIONS}[$RANGE_DURATION])) by (le,instance)) + LABELS: instance + QUANTILE: 0.99 + COMMENT: The quantile time consumed of writing WAL into the persistent storage +*************************** 4. row *************************** +TABLE_NAME: etcd_wal_fsync_total_count + PROMQL: sum(increase(etcd_disk_wal_fsync_duration_seconds_count{$LABEL_CONDITIONS}[$RANGE_DURATION])) by (instance) + LABELS: instance + QUANTILE: 0 + COMMENT: The total count of writing WAL into the persistent storage +*************************** 5. row *************************** +TABLE_NAME: etcd_wal_fsync_total_time + PROMQL: sum(increase(etcd_disk_wal_fsync_duration_seconds_sum{$LABEL_CONDITIONS}[$RANGE_DURATION])) by (instance) + LABELS: instance + QUANTILE: 0 + COMMENT: The total time of writing WAL into the persistent storage +5 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-partitions.md b/information-schema/information-schema-partitions.md index 6d0a39675df1b..3d819119b2595 100644 --- a/information-schema/information-schema-partitions.md +++ b/information-schema/information-schema-partitions.md @@ -4,7 +4,109 @@ summary: Learn the `PARTITIONS` information_schema table. category: reference --- - # PARTITIONS -todo!!! \ No newline at end of file +The `PARTITIONS` table provides information about partitioned tables. + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC partitions; +``` + +``` ++-------------------------------+--------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------------------------+--------------+------+------+---------+-------+ +| TABLE_CATALOG | varchar(512) | YES | | NULL | | +| TABLE_SCHEMA | varchar(64) | YES | | NULL | | +| TABLE_NAME | varchar(64) | YES | | NULL | | +| PARTITION_NAME | varchar(64) | YES | | NULL | | +| SUBPARTITION_NAME | varchar(64) | YES | | NULL | | +| PARTITION_ORDINAL_POSITION | bigint(21) | YES | | NULL | | +| SUBPARTITION_ORDINAL_POSITION | bigint(21) | YES | | NULL | | +| PARTITION_METHOD | varchar(18) | YES | | NULL | | +| SUBPARTITION_METHOD | varchar(12) | YES | | NULL | | +| PARTITION_EXPRESSION | longblob | YES | | NULL | | +| SUBPARTITION_EXPRESSION | longblob | YES | | NULL | | +| PARTITION_DESCRIPTION | longblob | YES | | NULL | | +| TABLE_ROWS | bigint(21) | YES | | NULL | | +| AVG_ROW_LENGTH | bigint(21) | YES | | NULL | | +| DATA_LENGTH | bigint(21) | YES | | NULL | | +| MAX_DATA_LENGTH | bigint(21) | YES | | NULL | | +| INDEX_LENGTH | bigint(21) | YES | | NULL | | +| DATA_FREE | bigint(21) | YES | | NULL | | +| CREATE_TIME | datetime | YES | | NULL | | +| UPDATE_TIME | datetime | YES | | NULL | | +| CHECK_TIME | datetime | YES | | NULL | | +| CHECKSUM | bigint(21) | YES | | NULL | | +| PARTITION_COMMENT | varchar(80) | YES | | NULL | | +| NODEGROUP | varchar(12) | YES | | NULL | | +| TABLESPACE_NAME | varchar(64) | YES | | NULL | | ++-------------------------------+--------------+------+------+---------+-------+ +25 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +CREATE TABLE test.t1 (id INT NOT NULL PRIMARY KEY) PARTITION BY HASH (id) PARTITIONS 2; +SELECT * FROM partitions WHERE table_schema='test' AND table_name='t1'\G +``` + +``` +*************************** 1. row *************************** + TABLE_CATALOG: def + TABLE_SCHEMA: test + TABLE_NAME: t1 + PARTITION_NAME: p0 + SUBPARTITION_NAME: NULL + PARTITION_ORDINAL_POSITION: 1 +SUBPARTITION_ORDINAL_POSITION: NULL + PARTITION_METHOD: HASH + SUBPARTITION_METHOD: NULL + PARTITION_EXPRESSION: `id` + SUBPARTITION_EXPRESSION: NULL + PARTITION_DESCRIPTION: + TABLE_ROWS: 0 + AVG_ROW_LENGTH: 0 + DATA_LENGTH: 0 + MAX_DATA_LENGTH: 0 + INDEX_LENGTH: 0 + DATA_FREE: 0 + CREATE_TIME: 2020-07-06 16:35:28 + UPDATE_TIME: NULL + CHECK_TIME: NULL + CHECKSUM: NULL + PARTITION_COMMENT: + NODEGROUP: NULL + TABLESPACE_NAME: NULL +*************************** 2. row *************************** + TABLE_CATALOG: def + TABLE_SCHEMA: test + TABLE_NAME: t1 + PARTITION_NAME: p1 + SUBPARTITION_NAME: NULL + PARTITION_ORDINAL_POSITION: 2 +SUBPARTITION_ORDINAL_POSITION: NULL + PARTITION_METHOD: HASH + SUBPARTITION_METHOD: NULL + PARTITION_EXPRESSION: `id` + SUBPARTITION_EXPRESSION: NULL + PARTITION_DESCRIPTION: + TABLE_ROWS: 0 + AVG_ROW_LENGTH: 0 + DATA_LENGTH: 0 + MAX_DATA_LENGTH: 0 + INDEX_LENGTH: 0 + DATA_FREE: 0 + CREATE_TIME: 2020-07-06 16:35:28 + UPDATE_TIME: NULL + CHECK_TIME: NULL + CHECKSUM: NULL + PARTITION_COMMENT: + NODEGROUP: NULL + TABLESPACE_NAME: NULL +2 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index d03a9e86e8205..618f05c46583c 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -7,16 +7,19 @@ category: reference # PROCESSLIST -`PROCESSLIST`, just like `show processlist`, is used to view the requests that are being handled. +`PROCESSLIST`, just like `SHOW PROCESSLIST`, is used to view the requests that are being handled. -The `PROCESSLIST` table has a `MEM` column that `show processlist` does not have. `MEM` means the occupied memory of the requests being handled, and its unit is `byte`. +The `PROCESSLIST` table has additional columns not present in `SHOW PROCESSLIST`: + +* A `MEM` column to show memory occupied by the request being handled (in bytes) +* A `TxnStart` column to show the start time of the transaction {{< copyable "sql" >}} ```sql -use information_schema; -desc processlist; +USE information_schema; +DESC processlist; ``` ``` diff --git a/information-schema/information-schema-schemata.md b/information-schema/information-schema-schemata.md index b4a2f98bfae81..169ee9774c020 100644 --- a/information-schema/information-schema-schemata.md +++ b/information-schema/information-schema-schemata.md @@ -7,12 +7,12 @@ category: reference # SCHEMATA -The `SCHEMATA` table provides information about databases. The table data is equivalent to the result of the `SHOW DATABASES` statement: +The `SCHEMATA` table provides information about databases. The table data is equivalent to the result of the `SHOW DATABASES` statement. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; desc SCHEMATA; ``` diff --git a/information-schema/information-schema-sequences.md b/information-schema/information-schema-sequences.md index e69de29bb2d1d..3abaac5ebe94c 100644 --- a/information-schema/information-schema-sequences.md +++ b/information-schema/information-schema-sequences.md @@ -0,0 +1,66 @@ +--- +title: SEQUENCES +summary: Learn the `SEQUENCES` information_schema table. +category: reference +--- + +# SEQUENCES + +The `SEQUENCES` table provides information about sequences. The [sequences feature](/sql-statements/sql-statement-create-sequence.md) is modeled on a similar feature in MariaDB. + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC sequences; +``` + +``` ++-----------------+--------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-----------------+--------------+------+------+---------+-------+ +| TABLE_CATALOG | varchar(512) | NO | | NULL | | +| SEQUENCE_SCHEMA | varchar(64) | NO | | NULL | | +| SEQUENCE_NAME | varchar(64) | NO | | NULL | | +| CACHE | tinyint(4) | NO | | NULL | | +| CACHE_VALUE | bigint(21) | YES | | NULL | | +| CYCLE | tinyint(4) | NO | | NULL | | +| INCREMENT | bigint(21) | NO | | NULL | | +| MAX_VALUE | bigint(21) | YES | | NULL | | +| MIN_VALUE | bigint(21) | YES | | NULL | | +| START | bigint(21) | YES | | NULL | | +| COMMENT | varchar(64) | YES | | NULL | | ++-----------------+--------------+------+------+---------+-------+ +11 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +CREATE SEQUENCE test.seq; +SELECT nextval(test.seq); +SELECT * FROM sequences\G +``` + +```sql ++-------------------+ +| nextval(test.seq) | ++-------------------+ +| 1 | ++-------------------+ +1 row in set (0.01 sec) + +*************************** 1. row *************************** + TABLE_CATALOG: def +SEQUENCE_SCHEMA: test + SEQUENCE_NAME: seq + CACHE: 1 + CACHE_VALUE: 1000 + CYCLE: 0 + INCREMENT: 1 + MAX_VALUE: 9223372036854775806 + MIN_VALUE: 1 + START: 1 + COMMENT: +1 row in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-session-variables.md b/information-schema/information-schema-session-variables.md index a85f3d19f50f1..c4ba00c22a82b 100644 --- a/information-schema/information-schema-session-variables.md +++ b/information-schema/information-schema-session-variables.md @@ -12,8 +12,8 @@ The `SESSION_VARIABLES` table provides information about session variables. The {{< copyable "sql" >}} ```sql -use information_schema; -desc session_variables; +USE information_schema; +DESC session_variables; ``` ``` diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index 7918c248adb6b..688236ad4fc30 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -12,8 +12,8 @@ The `SLOW_QUERY` table provides the slow query information of the current node, {{< copyable "sql" >}} ```sql -use information_schema; -desc slow_query; +USE information_schema; +DESC slow_query; ``` ``` diff --git a/information-schema/information-schema-statistics.md b/information-schema/information-schema-statistics.md index 98ffbaae7481b..437e84c61a34f 100644 --- a/information-schema/information-schema-statistics.md +++ b/information-schema/information-schema-statistics.md @@ -7,13 +7,13 @@ category: reference # STATISTICS -The `STATISTICS` table provides information about table indexes: +The `STATISTICS` table provides information about table indexes. {{< copyable "sql" >}} ```sql -use information_schema; -desc statistics; +USE information_schema; +DESC statistics; ``` ``` diff --git a/information-schema/information-schema-table-constraints.md b/information-schema/information-schema-table-constraints.md index d7f782765419b..a57897d8c50c7 100644 --- a/information-schema/information-schema-table-constraints.md +++ b/information-schema/information-schema-table-constraints.md @@ -7,13 +7,13 @@ category: reference # TABLE_CONSTRAINTS -The `TABLE_CONSTRAINTS` table describes which tables have constraints: +The `TABLE_CONSTRAINTS` table describes which tables have constraints. {{< copyable "sql" >}} ```sql -use information_schema; -desc table_constraints; +USE information_schema; +DESC table_constraints; ``` ``` diff --git a/information-schema/information-schema-table-storage-stats.md b/information-schema/information-schema-table-storage-stats.md index e69de29bb2d1d..f62b63c6ba95e 100644 --- a/information-schema/information-schema-table-storage-stats.md +++ b/information-schema/information-schema-table-storage-stats.md @@ -0,0 +1,53 @@ +--- +title: TABLE_STORAGE_STATS +summary: Learn the `TABLE_STORAGE_STATS` information_schema table. +category: reference +--- + +# TABLE_STORAGE_STATS + +The `TABLE_STORAGE_STATS` table provides information about table sizes as stored by the storage engine (TiKV). + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC table_storage_stats; +``` + +``` ++--------------------+-------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------------------+-------------+------+------+---------+-------+ +| TABLE_SCHEMA | varchar(64) | YES | | NULL | | +| TABLE_NAME | varchar(64) | YES | | NULL | | +| TABLE_ID | bigint(21) | YES | | NULL | | +| PEER_COUNT | bigint(21) | YES | | NULL | | +| REGION_COUNT | bigint(21) | YES | | NULL | | +| EMPTY_REGION_COUNT | bigint(21) | YES | | NULL | | +| TABLE_SIZE | bigint(64) | YES | | NULL | | +| TABLE_KEYS | bigint(64) | YES | | NULL | | ++--------------------+-------------+------+------+---------+-------+ +8 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +CREATE TABLE test.t1 (id INT); +INSERT INTO test.t1 VALUES (1); +SELECT * FROM table_storage_stats WHERE table_schema = 'test' AND table_name = 't1'\G +``` + +``` +*************************** 1. row *************************** + TABLE_SCHEMA: test + TABLE_NAME: t1 + TABLE_ID: 56 + PEER_COUNT: 1 + REGION_COUNT: 1 +EMPTY_REGION_COUNT: 1 + TABLE_SIZE: 1 + TABLE_KEYS: 0 +1 row in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-tables.md b/information-schema/information-schema-tables.md index 02df1ea06cf47..772085282f196 100644 --- a/information-schema/information-schema-tables.md +++ b/information-schema/information-schema-tables.md @@ -12,8 +12,8 @@ The `TABLES` table provides information about tables in databases: {{< copyable "sql" >}} ```sql -use information_schema; -desc tables; +USE information_schema; +DESC tables; ``` ``` diff --git a/information-schema/information-schema-tidb-hot-regions.md b/information-schema/information-schema-tidb-hot-regions.md index eebb5fad979c4..534bfc45513a0 100644 --- a/information-schema/information-schema-tidb-hot-regions.md +++ b/information-schema/information-schema-tidb-hot-regions.md @@ -12,8 +12,8 @@ The `TIDB_HOT_REGIONS` table provides information about hotspot Regions. {{< copyable "sql" >}} ```sql -use information_schema; -desc TIDB_HOT_REGIONS; +USE information_schema; +DESC tidb_hot_regions; ``` ``` diff --git a/information-schema/information-schema-tidb-indexes.md b/information-schema/information-schema-tidb-indexes.md index 20915d43e9311..7fe9968fa8c61 100644 --- a/information-schema/information-schema-tidb-indexes.md +++ b/information-schema/information-schema-tidb-indexes.md @@ -12,8 +12,8 @@ The `TIDB_INDEXES` table provides the INDEX information of all tables. {{< copyable "sql" >}} ```sql -use information_schema; -desc TIDB_INDEXES; +USE information_schema; +DESC tidb_indexes; ``` ``` @@ -36,17 +36,17 @@ desc TIDB_INDEXES; `INDEX_ID` is the unique ID that TiDB allocates for each index. It can be used to do a join operation with `INDEX_ID` obtained from another table or API. -For example, you can obtain `TABLE_ID` and `INDEX_ID` that are involved in some slow query in the [`SLOW_QUERY` table](#slow_query-table) and then obtain the specific index information using the following SQL statements: +For example, you can obtain `TABLE_ID` and `INDEX_ID` that are involved in some slow query in the [`SLOW_QUERY` table](/information-schema/information-schema-slow-query.md) and then obtain the specific index information using the following SQL statements: ```sql SELECT - tidb_indexes.* + tidb_indexes.* FROM - tidb_indexes, - tables + tidb_indexes, + tables WHERE - tidb_indexes.table_schema = tables.table_schema - AND tidb_indexes.table_name = tidb_indexes.table_name - AND tables.tidb_table_id = ? - AND index_id = ? + tidb_indexes.table_schema = tables.table_schema + AND tidb_indexes.table_name = tidb_indexes.table_name + AND tables.tidb_table_id = ? + AND index_id = ? ``` diff --git a/information-schema/information-schema-tidb-servers-info.md b/information-schema/information-schema-tidb-servers-info.md index e69de29bb2d1d..3aa46f9848830 100644 --- a/information-schema/information-schema-tidb-servers-info.md +++ b/information-schema/information-schema-tidb-servers-info.md @@ -0,0 +1,51 @@ +--- +title: TIDB_SERVERS_INFO +summary: Learn the `TIDB_SERVERS_INFO` information_schema table. +category: reference +--- + +# TIDB_SERVERS_INFO + +The `TIDB_SERVERS_INFO` table provides information about TiDB servers in the TiDB Cluster (i.e. tidb-server processes). + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC tidb_servers_info; +``` + +``` ++---------------+-------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------------+-------------+------+------+---------+-------+ +| DDL_ID | varchar(64) | YES | | NULL | | +| IP | varchar(64) | YES | | NULL | | +| PORT | bigint(21) | YES | | NULL | | +| STATUS_PORT | bigint(21) | YES | | NULL | | +| LEASE | varchar(64) | YES | | NULL | | +| VERSION | varchar(64) | YES | | NULL | | +| GIT_HASH | varchar(64) | YES | | NULL | | +| BINLOG_STATUS | varchar(64) | YES | | NULL | | ++---------------+-------------+------+------+---------+-------+ +8 rows in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +SELECT * FROM tidb_servers_info\G +``` + +``` +*************************** 1. row *************************** + DDL_ID: 771c169d-0a3a-48ea-a93c-a4d6751d3674 + IP: 0.0.0.0 + PORT: 4000 + STATUS_PORT: 10080 + LEASE: 45s + VERSION: 5.7.25-TiDB-v4.0.0-beta.2-720-g0df3b74f5 + GIT_HASH: 0df3b74f55f8f8fbde39bbd5d471783f49dc10f7 +BINLOG_STATUS: Off +1 row in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-tiflash-replica.md b/information-schema/information-schema-tiflash-replica.md index 8ef28f7a6ea39..3403aeafebdf6 100644 --- a/information-schema/information-schema-tiflash-replica.md +++ b/information-schema/information-schema-tiflash-replica.md @@ -1,5 +1,31 @@ --- -title: XXX -summary: Learn the `XXX` information_schema table. +title: TIFLASH_REPLICA +summary: Learn the `TIFLASH_REPLICA` information_schema table. category: reference --- + +# TIFLASH_REPLICA + +The `TIFLASH_REPLICA` table provides information about TiFlash replicas available. + +{{< copyable "sql" >}} + +```sql +USE information_schema; +DESC tiflash_replica; +``` + +``` ++-----------------+-------------+------+------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-----------------+-------------+------+------+---------+-------+ +| TABLE_SCHEMA | varchar(64) | YES | | NULL | | +| TABLE_NAME | varchar(64) | YES | | NULL | | +| TABLE_ID | bigint(21) | YES | | NULL | | +| REPLICA_COUNT | bigint(64) | YES | | NULL | | +| LOCATION_LABELS | varchar(64) | YES | | NULL | | +| AVAILABLE | tinyint(1) | YES | | NULL | | +| PROGRESS | double | YES | | NULL | | ++-----------------+-------------+------+------+---------+-------+ +7 rows in set (0.01 sec) +``` diff --git a/information-schema/information-schema-tikv-region-peers.md b/information-schema/information-schema-tikv-region-peers.md index 25a0dd16b6677..f5ea01159a458 100644 --- a/information-schema/information-schema-tikv-region-peers.md +++ b/information-schema/information-schema-tikv-region-peers.md @@ -6,13 +6,13 @@ category: reference # TIKV_REGION_PEERS -The `TIKV_REGION_PEERS` table provides the peer information of all Regions. +The `TIKV_REGION_PEERS` table shows detailed information of a single Region node in TiKV, such as whether it is a learner or leader. {{< copyable "sql" >}} ```sql -use information_schema; -DESC TIKV_REGION_PEERS; +USE information_schema; +DESC tikv_region_peers; ``` ``` @@ -27,57 +27,22 @@ DESC TIKV_REGION_PEERS; | STATUS | varchar(10) | YES | | 0 | | | DOWN_SECONDS | bigint(21) | YES | | 0 | | +--------------+-------------+------+------+---------+-------+ -7 rows in set (0.00 sec) -``` - - -## TIKV\_REGION\_PEERS table - -The `TIKV_REGION_PEERS` table shows detailed information of a single Region node in TiKV, like whether it is a learner or leader. - -{{< copyable "sql" >}} - -```sql -desc tikv_region_peers\G -``` - -``` -*************************** 1. row *************************** - Table: TIKV_REGION_PEERS -Create Table: CREATE TABLE `TIKV_REGION_PEERS` ( - `REGION_ID` bigint(21) unsigned DEFAULT NULL, - `PEER_ID` bigint(21) unsigned DEFAULT NULL, - `STORE_ID` bigint(21) unsigned DEFAULT NULL, - `IS_LEARNER` tinyint(1) unsigned DEFAULT NULL, - `IS_LEADER` tinyint(1) unsigned DEFAULT NULL, - `STATUS` varchar(10) DEFAULT NULL, - `DOWN_SECONDS` bigint(21) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin -1 row in set (0.00 sec) +7 rows in set (0.01 sec) ``` For example, you can query the specific TiKV addresses for the top 3 Regions with the maximum value of `WRITTEN_BYTES` using the following SQL statement: ```sql -select - address, - tikv.address, - region.region_id, -from - tikv_store_status tikv, - tikv_region_peers peer, - ( - select - * - from - tikv_region_status region - order by - written_bytes desc limit 3 - ) - region -where - region.region_id = peer.region_id - and peer.is_leader = 1 - and peer.store_id = tikv.region_id -``` - +SELECT + address, + tikv.address, + region.region_id +FROM + tikv_store_status tikv, + tikv_region_peers peer, + (SELECT * FROM tikv_region_status ORDER BY written_bytes DESC LIMIT 3) region +WHERE + region.region_id = peer.region_id + AND peer.is_leader = 1 + AND peer.store_id = tikv.store_id; + ``` \ No newline at end of file diff --git a/information-schema/information-schema-tikv-region-status.md b/information-schema/information-schema-tikv-region-status.md index e028ecaf1df8d..9decc5b667a94 100644 --- a/information-schema/information-schema-tikv-region-status.md +++ b/information-schema/information-schema-tikv-region-status.md @@ -6,14 +6,14 @@ category: reference # TIKV_REGION_STATUS -The `TIKV_REGION_STATUS` table provides the status information of all Regions. +The `TIKV_REGION_STATUS` table shows some basic information of TiKV Regions via PD's API, like the Region ID, starting and ending key-values, and read and write traffic. {{< copyable "sql" >}} ```sql -use information_schema; -DESC TIKV_REGION_STATUS; +USE information_schema; +DESC tikv_region_status; ``` ``` @@ -41,37 +41,10 @@ DESC TIKV_REGION_STATUS; 17 rows in set (0.00 sec) ``` -## TIKV\_REGION\_STATUS table - -The `TIKV_REGION_STATUS` table shows some basic information of TiKV Regions via PD's API, like the Region ID, starting and ending key-values, and read and write traffic. - -{{< copyable "sql" >}} - -```sql -desc tikv_region_status\G -``` - -``` -*************************** 1. row *************************** - Table: TIKV_REGION_STATUS -Create Table: CREATE TABLE `TIKV_REGION_STATUS` ( - `REGION_ID` bigint(21) unsigned DEFAULT NULL, - `START_KEY` text DEFAULT NULL, - `END_KEY` text DEFAULT NULL, - `EPOCH_CONF_VER` bigint(21) unsigned DEFAULT NULL, - `EPOCH_VERSION` bigint(21) unsigned DEFAULT NULL, - `WRITTEN_BYTES` bigint(21) unsigned DEFAULT NULL, - `READ_BYTES` bigint(21) unsigned DEFAULT NULL, - `APPROXIMATE_SIZE` bigint(21) unsigned DEFAULT NULL, - `APPROXIMATE_KEYS` bigint(21) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin -1 row in set (0.00 sec) -``` - You can implement the `top confver`, `top read` and `top write` operations in pd-ctl via the `ORDER BY X LIMIT Y` operation on the `EPOCH_CONF_VER`, `WRITTEN_BYTES` and `READ_BYTES` columns. You can query the top 3 Regions with the most write data using the following SQL statement: -``` -select * from tikv_region_status order by written_bytes desc limit 3; +```sql +SELECT * FROM tikv_region_status ORDER BY written_bytes DESC LIMIT 3; ``` \ No newline at end of file diff --git a/information-schema/information-schema-tikv-store-status.md b/information-schema/information-schema-tikv-store-status.md index 5b6ef66ae2f0a..384863b3a009e 100644 --- a/information-schema/information-schema-tikv-store-status.md +++ b/information-schema/information-schema-tikv-store-status.md @@ -7,13 +7,13 @@ category: reference # TIKV_STORE_STATUS -The `TIKV_STORE_STATUS` table provides the status information of all TiKV Stores. +The `TIKV_STORE_STATUS` table shows some basic information of TiKV nodes via PD's API, like the ID allocated in the cluster, address and port, and status, capacity, and the number of Region leaders of the current node. {{< copyable "sql" >}} ```sql -use information_schema; -DESC TIKV_STORE_STATUS; +USE information_schema; +DESC tikv_store_status; ``` ``` @@ -42,40 +42,3 @@ DESC TIKV_STORE_STATUS; +-------------------+-------------+------+------+---------+-------+ 19 rows in set (0.00 sec) ``` - -## TIKV\_STORE\_STATUS table - -The `TIKV_STORE_STATUS` table shows some basic information of TiKV nodes via PD's API, like the ID allocated in the cluster, address and port, and status, capacity, and the number of Region leaders of the current node. - -{{< copyable "sql" >}} - -```sql -desc tikv_store_status\G -``` - -``` -*************************** 1. row *************************** - Table: TIKV_STORE_STATUS -Create Table: CREATE TABLE `TIKV_STORE_STATUS` ( - `STORE_ID` bigint(21) unsigned DEFAULT NULL, - `ADDRESS` varchar(64) DEFAULT NULL, - `STORE_STATE` bigint(21) unsigned DEFAULT NULL, - `STORE_STATE_NAME` varchar(64) DEFAULT NULL, - `LABEL` json unsigned DEFAULT NULL, - `VERSION` varchar(64) DEFAULT NULL, - `CAPACITY` varchar(64) DEFAULT NULL, - `AVAILABLE` varchar(64) DEFAULT NULL, - `LEADER_COUNT` bigint(21) unsigned DEFAULT NULL, - `LEADER_WEIGHT` bigint(21) unsigned DEFAULT NULL, - `LEADER_SCORE` bigint(21) unsigned DEFAULT NULL, - `LEADER_SIZE` bigint(21) unsigned DEFAULT NULL, - `REGION_COUNT` bigint(21) unsigned DEFAULT NULL, - `REGION_WEIGHT` bigint(21) unsigned DEFAULT NULL, - `REGION_SCORE` bigint(21) unsigned DEFAULT NULL, - `REGION_SIZE` bigint(21) unsigned DEFAULT NULL, - `START_TS` datetime unsigned DEFAULT NULL, - `LAST_HEARTBEAT_TS` datetime unsigned DEFAULT NULL, - `UPTIME` varchar(64) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin -1 row in set (0.01 sec) -``` \ No newline at end of file diff --git a/information-schema/information-schema-user-privileges.md b/information-schema/information-schema-user-privileges.md index 54796c2a94c3f..4e0538fd43e59 100644 --- a/information-schema/information-schema-user-privileges.md +++ b/information-schema/information-schema-user-privileges.md @@ -12,20 +12,60 @@ The `USER_PRIVILEGES` table provides information about global privileges. This i {{< copyable "sql" >}} ```sql -desc USER_PRIVILEGES; +USE information_schema; +DESC user_privileges; ``` ``` -+----------------|--------------|------|------|---------|-------+ ++----------------+--------------+------+------+---------+-------+ | Field | Type | Null | Key | Default | Extra | -+----------------|--------------|------|------|---------|-------+ ++----------------+--------------+------+------+---------+-------+ | GRANTEE | varchar(81) | YES | | NULL | | | TABLE_CATALOG | varchar(512) | YES | | NULL | | | PRIVILEGE_TYPE | varchar(64) | YES | | NULL | | | IS_GRANTABLE | varchar(3) | YES | | NULL | | -+----------------|--------------|------|------|---------|-------+ ++----------------+--------------+------+------+---------+-------+ 4 rows in set (0.00 sec) ``` +{{< copyable "sql" >}} +```sql +SELECT * FROM user_privileges; +``` +``` ++------------+---------------+-------------------------+--------------+ +| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE | ++------------+---------------+-------------------------+--------------+ +| 'root'@'%' | def | Select | YES | +| 'root'@'%' | def | Insert | YES | +| 'root'@'%' | def | Update | YES | +| 'root'@'%' | def | Delete | YES | +| 'root'@'%' | def | Create | YES | +| 'root'@'%' | def | Drop | YES | +| 'root'@'%' | def | Process | YES | +| 'root'@'%' | def | References | YES | +| 'root'@'%' | def | Alter | YES | +| 'root'@'%' | def | Show Databases | YES | +| 'root'@'%' | def | Super | YES | +| 'root'@'%' | def | Execute | YES | +| 'root'@'%' | def | Index | YES | +| 'root'@'%' | def | Create User | YES | +| 'root'@'%' | def | Trigger | YES | +| 'root'@'%' | def | Create View | YES | +| 'root'@'%' | def | Show View | YES | +| 'root'@'%' | def | Create Role | YES | +| 'root'@'%' | def | Drop Role | YES | +| 'root'@'%' | def | CREATE TEMPORARY TABLES | YES | +| 'root'@'%' | def | LOCK TABLES | YES | +| 'root'@'%' | def | CREATE ROUTINE | YES | +| 'root'@'%' | def | ALTER ROUTINE | YES | +| 'root'@'%' | def | EVENT | YES | +| 'root'@'%' | def | SHUTDOWN | YES | +| 'root'@'%' | def | RELOAD | YES | +| 'root'@'%' | def | FILE | YES | +| 'root'@'%' | def | CONFIG | YES | ++------------+---------------+-------------------------+--------------+ +28 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/information-schema/information-schema-views.md b/information-schema/information-schema-views.md index 125306626686d..046bcfe75bbe2 100644 --- a/information-schema/information-schema-views.md +++ b/information-schema/information-schema-views.md @@ -6,12 +6,12 @@ category: reference # VIEWS -The `VIEWS` table provides information about SQL views: +The `VIEWS` table provides information about SQL views. {{< copyable "sql" >}} ```sql -use information_schema; +USE information_schema; DESC views; ``` diff --git a/information-schema/system-table-character-sets.md b/information-schema/system-table-character-sets.md deleted file mode 100644 index 8b10b860496a2..0000000000000 --- a/information-schema/system-table-character-sets.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: CHARACTER_SETS -summary: Learn the `CHARACTER_SETS` information_schema table. -category: reference ---- - -# CHARACTER_SETS - -The `CHARACTER_SETS` table provides information about [character sets](/character-set-and-collation.md). Currently, TiDB only supports some of the character sets. - - -{{< copyable "sql" >}} - -```sql -use information_schema; -DESC character_sets; -``` - -``` -+----------------------+-------------+------+------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+----------------------+-------------+------+------+---------+-------+ -| CHARACTER_SET_NAME | varchar(32) | YES | | NULL | | -| DEFAULT_COLLATE_NAME | varchar(32) | YES | | NULL | | -| DESCRIPTION | varchar(60) | YES | | NULL | | -| MAXLEN | bigint(3) | YES | | NULL | | -+----------------------+-------------+------+------+---------+-------+ -4 rows in set (0.00 sec) -``` - -{{< copyable "sql" >}} - -```sql -SELECT * FROM character_sets; -``` - -``` -+--------------------+----------------------+---------------+--------+ -| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN | -+--------------------+----------------------+---------------+--------+ -| utf8 | utf8_bin | UTF-8 Unicode | 3 | -| utf8mb4 | utf8mb4_bin | UTF-8 Unicode | 4 | -| ascii | ascii_bin | US ASCII | 1 | -| latin1 | latin1_bin | Latin1 | 1 | -| binary | binary | binary | 1 | -+--------------------+----------------------+---------------+--------+ -5 rows in set (0.00 sec) -``` \ No newline at end of file diff --git a/metrics-schema.md b/metrics-schema.md index 3e159346d996f..9708ce6adae68 100644 --- a/metrics-schema.md +++ b/metrics-schema.md @@ -7,9 +7,97 @@ aliases: ['/docs/dev/system-tables/system-table-metrics-schema/','/docs/dev/refe # Metrics Schema -To dynamically observe and compare cluster conditions of different time ranges, the SQL diagnostic system introduces cluster monitoring system tables. All monitoring tables are in the `metrics_schema` database. You can query the monitoring information using SQL statements in this schema. The data of the three monitoring-related summary tables ([`metrics_summary`](/system-tables/system-table-metrics-summary.md), [`metrics_summary_by_label`](/system-tables/system-table-metrics-summary.md), and `inspection_result`) are all obtained by querying the monitoring tables in the metrics schema. Currently, many system tables are added, so you can query the information of these tables using the [`information_schema.metrics_tables`](/system-tables/system-table-metrics-tables.md) table. +The `METRICS_SCHEMA` is a set of views on top of TiDB metrics that are stored in Prometheus. The source of the PromQL (Prometheus Query Language) for each of the tables is available in [`INFORMATION_SCHEMA.METRICS_TABLES`](/informaition-schema/information-schema-metrics-tables.md). -## Overview +{{< copyable "sql" >}} + +```sql +use metrics_schema; +SELECT * FROM uptime; +SELECT * FROM information_schema.metrics_tables WHERE table_name='uptime'\G +``` + +```sql ++----------------------------+-----------------+------------+--------------------+ +| time | instance | job | value | ++----------------------------+-----------------+------------+--------------------+ +| 2020-07-06 15:26:26.203000 | 127.0.0.1:10080 | tidb | 123.60300016403198 | +| 2020-07-06 15:27:26.203000 | 127.0.0.1:10080 | tidb | 183.60300016403198 | +| 2020-07-06 15:26:26.203000 | 127.0.0.1:20180 | tikv | 123.60300016403198 | +| 2020-07-06 15:27:26.203000 | 127.0.0.1:20180 | tikv | 183.60300016403198 | +| 2020-07-06 15:26:26.203000 | 127.0.0.1:2379 | pd | 123.60300016403198 | +| 2020-07-06 15:27:26.203000 | 127.0.0.1:2379 | pd | 183.60300016403198 | +| 2020-07-06 15:26:26.203000 | 127.0.0.1:9090 | prometheus | 123.72300004959106 | +| 2020-07-06 15:27:26.203000 | 127.0.0.1:9090 | prometheus | 183.72300004959106 | ++----------------------------+-----------------+------------+--------------------+ +8 rows in set (0.00 sec) + +*************************** 1. row *************************** +TABLE_NAME: uptime + PROMQL: (time() - process_start_time_seconds{$LABEL_CONDITIONS}) + LABELS: instance,job + QUANTILE: 0 + COMMENT: TiDB uptime since last restart(second) +1 row in set (0.00 sec) +``` + +{{< copyable "sql" >}} + +```sql +show tables; +``` + +```sql ++---------------------------------------------------+ +| Tables_in_metrics_schema | ++---------------------------------------------------+ +| abnormal_stores | +| etcd_disk_wal_fsync_rate | +| etcd_wal_fsync_duration | +| etcd_wal_fsync_total_count | +| etcd_wal_fsync_total_time | +| go_gc_count | +| go_gc_cpu_usage | +| go_gc_duration | +| go_heap_mem_usage | +| go_threads | +| goroutines_count | +| node_cpu_usage | +| node_disk_available_size | +| node_disk_io_util | +| node_disk_iops | +| node_disk_read_latency | +| node_disk_size | +.. +| tikv_storage_async_request_total_time | +| tikv_storage_async_requests | +| tikv_storage_async_requests_total_count | +| tikv_storage_command_ops | +| tikv_store_size | +| tikv_thread_cpu | +| tikv_thread_nonvoluntary_context_switches | +| tikv_thread_voluntary_context_switches | +| tikv_threads_io | +| tikv_threads_state | +| tikv_total_keys | +| tikv_wal_sync_duration | +| tikv_wal_sync_max_duration | +| tikv_worker_handled_tasks | +| tikv_worker_handled_tasks_total_num | +| tikv_worker_pending_tasks | +| tikv_worker_pending_tasks_total_num | +| tikv_write_stall_avg_duration | +| tikv_write_stall_max_duration | +| tikv_write_stall_reason | +| up | +| uptime | ++---------------------------------------------------+ +626 rows in set (0.00 sec) +``` + +The `METRICS_SCHEMA` is used as a data source for monitoring-related summary tables such as ([`metrics_summary`](/information-schema/information-schema-metrics-summary.md), [`metrics_summary_by_label`](/information-schema/information-schema-metrics-summary.md) and [`inspection_summary`](/information-schema/information-schema-inspection-summary.md). + +## Additional Examples Taking the `tidb_query_duration` monitoring table in `metrics_schema` as an example, this section illustrates how to use this monitoring table and how it works. The working principles of other monitoring tables are similar to `tidb_query_duration`. diff --git a/mysql-schema.md b/mysql-schema.md index a9a3e76112c68..2b22065e73a4a 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -1,13 +1,13 @@ --- -title: TiDB System Tables -summary: Learn the TiDB system tables. +title: mysql +summary: Learn about the TiDB system tables. category: reference aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/'] --- -# TiDB System Tables +# mysql -This document introduces TiDB system tables. +The `mysql` schema contains TiDB system tables. The design is similar to the `mysql` schema in MySQL, where tables such as `mysql.user` can be edited directly. It also contains a number of tables which are extensions to MySQL. ## Grant system tables From b46639cfacc9596b8c44aaf55e5348bc7c9a2d56 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Mon, 6 Jul 2020 18:15:38 -0600 Subject: [PATCH 04/14] Add redirects from old locations --- .github/assign-by-files.yml | 2 +- TOC.md | 2 +- _index.md | 2 +- check-cluster-status-using-sql-statements.md | 16 +++++------ dashboard/dashboard-diagnostics-report.md | 4 +-- faq/tidb-faq.md | 2 +- identify-slow-queries.md | 4 +-- information-schema.md | 2 +- .../information-schema-cluster-config.md | 2 +- .../information-schema-cluster-hardware.md | 6 ++--- .../information-schema-cluster-info.md | 2 +- .../information-schema-cluster-load.md | 6 ++--- .../information-schema-cluster-log.md | 2 +- .../information-schema-cluster-systeminfo.md | 6 ++--- .../information-schema-ddl-jobs.md | 27 +++++++++---------- .../information-schema-engines.md | 1 - .../information-schema-inspection-result.md | 2 +- .../information-schema-inspection-rules.md | 2 +- .../information-schema-inspection-summary.md | 2 +- .../information-schema-key-column-usage.md | 1 - .../information-schema-metrics-summary.md | 2 +- .../information-schema-metrics-tables.md | 4 +-- .../information-schema-processlist.md | 3 --- .../information-schema-schemata.md | 1 - .../information-schema-session-variables.md | 1 - .../information-schema-slow-query.md | 4 +-- .../information-schema-sql-diagnostics.md | 24 ++++++++--------- .../information-schema-statistics.md | 1 - .../information-schema-table-constraints.md | 1 - .../information-schema-tables.md | 1 - .../information-schema-tidb-hot-regions.md | 4 +-- .../information-schema-tidb-indexes.md | 1 - .../information-schema-tikv-region-status.md | 1 - .../information-schema-tikv-store-status.md | 1 - .../information-schema-user-privileges.md | 1 - metrics-schema.md | 4 +-- mysql-schema.md | 2 +- .../sql-statement-show-analyze-status.md | 2 +- whats-new-in-tidb-4.0.md | 2 +- 39 files changed, 66 insertions(+), 87 deletions(-) diff --git a/.github/assign-by-files.yml b/.github/assign-by-files.yml index 3314d000052ac..145533c9eb396 100644 --- a/.github/assign-by-files.yml +++ b/.github/assign-by-files.yml @@ -73,7 +73,7 @@ # - TomShawn # - -# 'system-tables/**/*.md': +# 'information-schema/**/*.md': # - TomShawn # - diff --git a/TOC.md b/TOC.md index d25e47016be68..155b0da5801c6 100644 --- a/TOC.md +++ b/TOC.md @@ -81,7 +81,7 @@ + [TiFlash Alert Rules](/tiflash/tiflash-alert-rules.md) + Troubleshoot + [Identify Slow Queries](/identify-slow-queries.md) - + [SQL Diagnostics](/system-tables/system-table-sql-diagnostics.md) + + [SQL Diagnostics](/information-schema/information-schema-sql-diagnostics.md) + [Identify Expensive Queries](/identify-expensive-queries.md) + [Statement Summary Tables](/statement-summary-tables.md) + [Troubleshoot Cluster Setup](/troubleshoot-tidb-cluster.md) diff --git a/_index.md b/_index.md index 2f94b184be7ce..9325ac5a8c886 100644 --- a/_index.md +++ b/_index.md @@ -79,7 +79,7 @@ Designed for the cloud, TiDB provides flexible scalability, reliability and secu - [TiDB Troubleshooting Map](/tidb-troubleshooting-map.md) - [Identify Slow Queries](/identify-slow-queries.md) -- [SQL Diagnostics](/system-tables/system-table-sql-diagnostics.md) +- [SQL Diagnostics](/information-schema/information-schema-sql-diagnostics.md) - [Troubleshoot the TiDB Cluster](/troubleshoot-tidb-cluster.md) - [Troubleshoot TiCDC](/ticdc/troubleshoot-ticdc.md) - [Troubleshoot TiFlash](/tiflash/troubleshoot-tiflash.md) diff --git a/check-cluster-status-using-sql-statements.md b/check-cluster-status-using-sql-statements.md index fe0b44698abaf..37cfa85901ea7 100644 --- a/check-cluster-status-using-sql-statements.md +++ b/check-cluster-status-using-sql-statements.md @@ -11,18 +11,18 @@ TiDB offers some SQL statements and system tables to check the TiDB cluster stat The `INFORMATION_SCHEMA` system database offers system tables as follows to query the cluster status and diagnose common cluster issues: -- [`TABLES`](/system-tables/system-table-information-schema.md#tables-table) -- [`TIDB_INDEXES`](/system-tables/system-table-information-schema.md#tidb_indexes-table) -- [`ANALYZE_STATUS`](/system-tables/system-table-information-schema.md#analyze_status-table) -- [`TIDB_HOT_REGIONS`](/system-tables/system-table-information-schema.md#tidb_hot_regions-table) -- [`TIKV_STORE_STATUS`](/system-tables/system-table-information-schema.md#tikv_store_status-table) -- [`TIKV_REGION_STATUS`](/system-tables/system-table-information-schema.md#tikv_region_status-table) -- [`TIKV_REGION_PEERS`](/system-tables/system-table-information-schema.md#tikv_region_peers-table) +- [`TABLES`](/information-schema/information-schema-tables.md) +- [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) +- [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) +- [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) +- [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) +- [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) +- [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) You can also use the following statements to obtain some useful information for troubleshooting and querying the TiDB cluster status. - `ADMIN SHOW DDL`: obtains the ID of TiDB with the `DDL owner` role and `IP:PORT`. -- The feature of `SHOW ANALYZE STATUS` is the same with that of [the `ANALYZE_STATUS` table](/system-tables/system-table-information-schema.md#analyze_status-table). +- The feature of `SHOW ANALYZE STATUS` is the same with that of [the `ANALYZE_STATUS` table](/information-schema/information-schema-analyze-status.md). - Specific `EXPLAIN` statements - `EXPLAIN ANALYZE`: obtains some detailed information for execution of a SQL statement. - `EXPLAIN FOR CONNECTION`: obtains the execution plan for the query executed last in a connection. Can be used along with `SHOW PROCESSLIST`. diff --git a/dashboard/dashboard-diagnostics-report.md b/dashboard/dashboard-diagnostics-report.md index 85095f9589313..caa10898898de 100644 --- a/dashboard/dashboard-diagnostics-report.md +++ b/dashboard/dashboard-diagnostics-report.md @@ -63,7 +63,7 @@ The fields in the table above are described as follows: #### Cluster Topology Info -The `Cluster Info` table shows the cluster topology information. The information in this table are from TiDB [information_schema.cluster_info](/system-tables/system-table-cluster-info.md) system table. +The `Cluster Info` table shows the cluster topology information. The information in this table are from TiDB [information_schema.cluster_info](/information-schema/information-schema-cluster-info.md) system table. ![Cluster info](/media/dashboard/dashboard-diagnostics-cluster-info.png) @@ -79,7 +79,7 @@ The fields in the table above are described as follows: ### Diagnostic information -TiDB has built-in automatic diagnostic results. For the description of each field, see [information_schema.inspection-result](/system-tables/system-table-inspection-result.md) system table. +TiDB has built-in automatic diagnostic results. For the description of each field, see [information_schema.inspection-result](/information-schema/information-schema-inspection-result.md) system table. ### Load Info diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 06a5bd226c55a..95b8173fde50f 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -531,7 +531,7 @@ No. Currently, TiDB only supports the distributed storage engine and the Golevel #### Can the `Information_schema` support more real information? -As part of MySQL compatibility, TiDB supports a number of `INFORMATION_SCHEMA` tables. Many of these tables also have a corresponding SHOW command. For more information, see [Information Schema](/system-tables/system-table-information-schema.md). +As part of MySQL compatibility, TiDB supports a number of `INFORMATION_SCHEMA` tables. Many of these tables also have a corresponding SHOW command. For more information, see [Information Schema](/information-schema.md). #### What's the explanation of the TiDB Backoff type scenario? diff --git a/identify-slow-queries.md b/identify-slow-queries.md index 0133c53df6ad2..3915914c485d8 100644 --- a/identify-slow-queries.md +++ b/identify-slow-queries.md @@ -107,7 +107,7 @@ TiKV Coprocessor Task fields: ## Memory mapping in slow log -You can query the content of the slow query log by querying the `INFORMATION_SCHEMA.SLOW_QUERY` table. Each column name in the table corresponds to one field name in the slow log. For table structure, see the introduction to the `SLOW_QUERY` table in [Information Schema](/system-tables/system-table-information-schema.md#information-schema). +You can query the content of the slow query log by querying the `INFORMATION_SCHEMA.SLOW_QUERY` table. Each column name in the table corresponds to one field name in the slow log. For table structure, see the introduction to the `SLOW_QUERY` table in [Information Schema](/information-schema/information-schema-slow-query.md). > **Note:** > @@ -159,7 +159,7 @@ For TiDB 4.0, `SLOW_QUERY` supports querying the slow log of any period of time, > > If the slow log files of the specified time range are removed, or there is no slow query, the query returns NULL. -TiDB 4.0 adds the [`CLUSTER_SLOW_QUERY`](/system-tables/system-table-information-schema.md#cluster_slow_query-table) system table to query the slow query information of all TiDB nodes. The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query. You can use `CLUSTER_SLOW_QUERY` the way you do with [`SLOW_QUERY`](/system-tables/system-table-information-schema.md#slow_query-table). +TiDB 4.0 adds the [`CLUSTER_SLOW_QUERY`](/information-schema/information-schema-slow-query.md#cluster_slow_query-table) system table to query the slow query information of all TiDB nodes. The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query. You can use `CLUSTER_SLOW_QUERY` the way you do with [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md). When you query the `CLUSTER_SLOW_QUERY` table, TiDB pushes the computation and the judgment down to other nodes, instead of retrieving all slow query information from other nodes and executing the operations on one TiDB node. diff --git a/information-schema.md b/information-schema.md index c902036372f6b..4368aabdcf715 100644 --- a/information-schema.md +++ b/information-schema.md @@ -2,7 +2,7 @@ title: Information Schema summary: TiDB implements the ANSI-standard information_schema for viewing system metadata. category: reference -aliases: ['/docs/dev/information-schema/information-schema-information-schema/','/docs/dev/reference/system-databases/information-schema/'] +aliases: ['/docs/dev/information-schema/information-schema-information-schema/','/docs/dev/reference/system-databases/information-schema/','/tidb/dev/system-table-information-schema/'] --- # Information Schema diff --git a/information-schema/information-schema-cluster-config.md b/information-schema/information-schema-cluster-config.md index d00f3da721125..76c2cde839384 100644 --- a/information-schema/information-schema-cluster-config.md +++ b/information-schema/information-schema-cluster-config.md @@ -2,7 +2,7 @@ title: CLUSTER_CONFIG summary: Learn the `CLUSTER_CONFIG` information_schema table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-config/','/docs/dev/reference/system-databases/cluster-config/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-config/','/docs/dev/reference/system-databases/cluster-config/','/tidb/dev/system-table-cluster-config/'] --- # CLUSTER_CONFIG diff --git a/information-schema/information-schema-cluster-hardware.md b/information-schema/information-schema-cluster-hardware.md index 41f079373c8b7..5fb457c5b8129 100644 --- a/information-schema/information-schema-cluster-hardware.md +++ b/information-schema/information-schema-cluster-hardware.md @@ -2,7 +2,7 @@ title: CLUSTER_HARDWARE summary: Learn the `CLUSTER_HARDWARE` information_schema table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-hardware/','/docs/dev/reference/system-databases/cluster-hardware/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-hardware/','/docs/dev/reference/system-databases/cluster-hardware/','/tidb/dev/system-table-cluster-hardware/'] --- # CLUSTER_HARDWARE @@ -32,8 +32,8 @@ DESC cluster_hardware; Field description: -* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. -* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) cluster information table. +* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. +* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) cluster information table. * `DEVICE_TYPE`: Hardware type. Currently, you can query the `cpu`, `memory`, `disk`, and `net` types. * `DEVICE_NAME`: Hardware name. The value of `DEVICE_NAME` varies with `DEVICE_TYPE`. * `cpu`: The hardware name is cpu. diff --git a/information-schema/information-schema-cluster-info.md b/information-schema/information-schema-cluster-info.md index 3c07a75c63a03..2a305fa383083 100644 --- a/information-schema/information-schema-cluster-info.md +++ b/information-schema/information-schema-cluster-info.md @@ -2,7 +2,7 @@ title: CLUSTER_INFO summary: Learn the `CLUSTER_INFO` cluster topology information table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-info/','/docs/dev/reference/system-databases/cluster-info/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-info/','/docs/dev/reference/system-databases/cluster-info/','/tidb/dev/system-table-cluster-info/'] --- # CLUSTER_INFO diff --git a/information-schema/information-schema-cluster-load.md b/information-schema/information-schema-cluster-load.md index 749743188823f..751ca423d55b2 100644 --- a/information-schema/information-schema-cluster-load.md +++ b/information-schema/information-schema-cluster-load.md @@ -2,7 +2,7 @@ title: CLUSTER_LOAD summary: Learn the `CLUSTER_LOAD` information_schema table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-load/','/docs/dev/reference/system-databases/cluster-load/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-load/','/docs/dev/reference/system-databases/cluster-load/','/tidb/dev/system-table-cluster-load/'] --- # CLUSTER_LOAD @@ -32,8 +32,8 @@ DESC cluster_load; Field description: -* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. -* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) cluster information table. +* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. +* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) cluster information table. * `DEVICE_TYPE`: Hardware type. Currently, you can query the `cpu`, `memory`, `disk`, and `net` types. * `DEVICE_NAME`: Hardware name. The value of `DEVICE_NAME` varies with `DEVICE_TYPE`. * `cpu`: The hardware name is cpu. diff --git a/information-schema/information-schema-cluster-log.md b/information-schema/information-schema-cluster-log.md index 14086fa0c21c6..6d161f6984226 100644 --- a/information-schema/information-schema-cluster-log.md +++ b/information-schema/information-schema-cluster-log.md @@ -2,7 +2,7 @@ title: CLUSTER_LOG summary: Learn the `CLUSTER_LOG` information_schema table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-log/','/docs/dev/reference/system-databases/cluster-log/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-log/','/docs/dev/reference/system-databases/cluster-log/','/tidb/dev/system-table-cluster-log/'] --- # CLUSTER_LOG diff --git a/information-schema/information-schema-cluster-systeminfo.md b/information-schema/information-schema-cluster-systeminfo.md index 401ca6e966993..4348da1eb9a00 100644 --- a/information-schema/information-schema-cluster-systeminfo.md +++ b/information-schema/information-schema-cluster-systeminfo.md @@ -2,7 +2,7 @@ title: CLUSTER_SYSTEMINFO summary: Learn the `CLUSTER_SYSTEMINFO` kernel parameter table. category: reference -aliases: ['/docs/dev/system-tables/system-table-cluster-systeminfo/','/docs/dev/reference/system-databases/cluster-systeminfo/'] +aliases: ['/docs/dev/system-tables/system-table-cluster-systeminfo/','/docs/dev/reference/system-databases/cluster-systeminfo/','/tidb/dev/system-table-cluster-systeminfo/'] --- # CLUSTER_SYSTEMINFO @@ -32,8 +32,8 @@ DESC cluster_systeminfo; Field description: -* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. -* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md) cluster information table. +* `TYPE`: Corresponds to the `TYPE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) table. The optional values are `tidb`, `pd`, and `tikv`. +* `INSTANCE`: Corresponds to the `INSTANCE` field in the [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md) cluster information table. * `SYSTEM_TYPE`: The system type. Currently, you can query the `system` system type. * `SYSTEM_NAME`: The system name. Currently, you can query the `sysctl` system name. * `NAME`: The configuration name corresponding to `sysctl`. diff --git a/information-schema/information-schema-ddl-jobs.md b/information-schema/information-schema-ddl-jobs.md index 9c5f88258b606..030b966eabbfb 100644 --- a/information-schema/information-schema-ddl-jobs.md +++ b/information-schema/information-schema-ddl-jobs.md @@ -4,7 +4,6 @@ summary: Learn the `DDL_JOBS` information_schema table. category: reference --- - # DDL_JOBS The `DDL_JOBS` table provides an `INFORMATION_SCHEMA` interface to the `ADMIN SHOW DDL JOBS` command. It provides both the current status and a short history of DDL operations across the TiDB cluster. @@ -56,8 +55,8 @@ SCHEMA_STATE: public END_TIME: 2020-07-06 15:24:27 STATE: synced QUERY: CREATE TABLE IF NOT EXISTS mysql.opt_rule_blacklist ( - name char(100) NOT NULL - ); + name char(100) NOT NULL + ); *************************** 2. row *************************** JOB_ID: 42 DB_NAME: mysql @@ -71,10 +70,10 @@ SCHEMA_STATE: public END_TIME: 2020-07-06 15:24:27 STATE: synced QUERY: CREATE TABLE IF NOT EXISTS mysql.expr_pushdown_blacklist ( - name char(100) NOT NULL, - store_type char(100) NOT NULL DEFAULT 'tikv,tiflash,tidb', - reason varchar(200) - ); + name char(100) NOT NULL, + store_type char(100) NOT NULL DEFAULT 'tikv,tiflash,tidb', + reason varchar(200) + ); *************************** 3. row *************************** JOB_ID: 40 DB_NAME: mysql @@ -88,12 +87,12 @@ SCHEMA_STATE: public END_TIME: 2020-07-06 15:24:27 STATE: synced QUERY: CREATE TABLE if not exists mysql.stats_top_n ( - table_id bigint(64) NOT NULL, - is_index tinyint(2) NOT NULL, - hist_id bigint(64) NOT NULL, - value longblob, - count bigint(64) UNSIGNED NOT NULL, - index tbl(table_id, is_index, hist_id) - ); + table_id bigint(64) NOT NULL, + is_index tinyint(2) NOT NULL, + hist_id bigint(64) NOT NULL, + value longblob, + count bigint(64) UNSIGNED NOT NULL, + index tbl(table_id, is_index, hist_id) + ); 3 rows in set (0.01 sec) ``` \ No newline at end of file diff --git a/information-schema/information-schema-engines.md b/information-schema/information-schema-engines.md index 71062436b21fd..a2554f5834650 100644 --- a/information-schema/information-schema-engines.md +++ b/information-schema/information-schema-engines.md @@ -8,7 +8,6 @@ category: reference The `ENGINES` table provides information about storage engines. For compatibility, TiDB will always describe InnoDB as the only supported engine. In addition, other column values in the `ENGINES` table are also fixed values. - {{< copyable "sql" >}} ```sql diff --git a/information-schema/information-schema-inspection-result.md b/information-schema/information-schema-inspection-result.md index 2eb91c4bd2ad7..f326b63d73a44 100644 --- a/information-schema/information-schema-inspection-result.md +++ b/information-schema/information-schema-inspection-result.md @@ -2,7 +2,7 @@ title: INSPECTION_RESULT summary: Learn the `INSPECTION_RESULT` diagnostic result table. category: reference -aliases: ['/docs/dev/system-tables/system-table-inspection-result/','/docs/dev/reference/system-databases/inspection-result/'] +aliases: ['/docs/dev/system-tables/system-table-inspection-result/','/docs/dev/reference/system-databases/inspection-result/','/tidb/dev/system-table-inspection-result/'] --- # INSPECTION_RESULT diff --git a/information-schema/information-schema-inspection-rules.md b/information-schema/information-schema-inspection-rules.md index 68acb50ac79a3..9f072f01a8586 100644 --- a/information-schema/information-schema-inspection-rules.md +++ b/information-schema/information-schema-inspection-rules.md @@ -6,7 +6,7 @@ category: reference # INSPECTION_RULES -The `INSPECTION_RULES` table provides information about which diagnostic tests are run in an inspection result. See [inspection result](/information-schema/information-schema/inspection-result.md) for example usage. +The `INSPECTION_RULES` table provides information about which diagnostic tests are run in an inspection result. See [inspection result](/information-schema/information-schema-inspection-result.md) for example usage. {{< copyable "sql" >}} diff --git a/information-schema/information-schema-inspection-summary.md b/information-schema/information-schema-inspection-summary.md index 5b1fd165d0aee..66fdaf459a028 100644 --- a/information-schema/information-schema-inspection-summary.md +++ b/information-schema/information-schema-inspection-summary.md @@ -2,7 +2,7 @@ title: INSPECTION_SUMMARY summary: Learn the `INSPECTION_SUMMARY` inspection summary table. category: reference -aliases: ['/docs/dev/system-tables/system-table-inspection-summary/','/docs/dev/reference/system-databases/inspection-summary/'] +aliases: ['/docs/dev/system-tables/system-table-inspection-summary/','/docs/dev/reference/system-databases/inspection-summary/','/tidb/dev/system-table-inspection-summary/'] --- # INSPECTION_SUMMARY diff --git a/information-schema/information-schema-key-column-usage.md b/information-schema/information-schema-key-column-usage.md index ffcf5e37237e8..bdab89bc14cd1 100644 --- a/information-schema/information-schema-key-column-usage.md +++ b/information-schema/information-schema-key-column-usage.md @@ -4,7 +4,6 @@ summary: Learn the `KEY_COLUMN_USAGE` information_schema table. category: reference --- - # KEY_COLUMN_USAGE The `KEY_COLUMN_USAGE` table describes the key constraints of the columns, such as the primary key constraint. diff --git a/information-schema/information-schema-metrics-summary.md b/information-schema/information-schema-metrics-summary.md index da9e85de76f67..e7e4b9ac4962b 100644 --- a/information-schema/information-schema-metrics-summary.md +++ b/information-schema/information-schema-metrics-summary.md @@ -2,7 +2,7 @@ title: METRICS_SUMMARY summary: Learn the `METRICS_SUMMARY` system table. category: reference -aliases: ['/docs/dev/system-tables/system-table-metrics-summary/','/docs/dev/reference/system-databases/metrics-summary/'] +aliases: ['/docs/dev/system-tables/system-table-metrics-summary/','/docs/dev/reference/system-databases/metrics-summary/',''/tidb/dev/system-table-metrics-summary/''] --- # METRICS_SUMMARY diff --git a/information-schema/information-schema-metrics-tables.md b/information-schema/information-schema-metrics-tables.md index 4fdafd87b36ab..0ced0e16a71ea 100644 --- a/information-schema/information-schema-metrics-tables.md +++ b/information-schema/information-schema-metrics-tables.md @@ -2,7 +2,7 @@ title: METRICS_TABLES summary: Learn the `METRICS_TABLES` system table. category: reference -aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/reference/system-databases/metrics-tables/'] +aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/reference/system-databases/metrics-tables/',''/tidb/dev/system-table-metrics-tables/''] --- # METRICS_TABLES @@ -36,8 +36,6 @@ Field description: * `QUANTILE`: The percentile. For monitoring data of the histogram type, a default percentile is specified. If the value of this field is `0`, it means that the monitoring item corresponding to the monitoring table is not a histogram. * `COMMENT`: The comment about the monitoring table. - - {{< copyable "sql" >}} ```sql diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index 618f05c46583c..c675d3bf391f3 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -4,7 +4,6 @@ summary: Learn the `PROCESSLIST` information_schema table. category: reference --- - # PROCESSLIST `PROCESSLIST`, just like `SHOW PROCESSLIST`, is used to view the requests that are being handled. @@ -16,7 +15,6 @@ The `PROCESSLIST` table has additional columns not present in `SHOW PROCESSLIST` {{< copyable "sql" >}} - ```sql USE information_schema; DESC processlist; @@ -61,7 +59,6 @@ TxnStart: 1 row in set (0.00 sec) ``` - ## CLUSTER_PROCESSLIST `CLUSTER_PROCESSLIST` is the cluster system table corresponding to `PROCESSLIST`. It is used to query the `PROCESSLIST` information of all TiDB nodes in the cluster. The table schema of `CLUSTER_PROCESSLIST` has one more column than `PROCESSLIST`, the `INSTANCE` column, which stores the address of the TiDB node this row of data is from. diff --git a/information-schema/information-schema-schemata.md b/information-schema/information-schema-schemata.md index 169ee9774c020..4657674ae373c 100644 --- a/information-schema/information-schema-schemata.md +++ b/information-schema/information-schema-schemata.md @@ -4,7 +4,6 @@ summary: Learn the `SCHEMATA` information_schema table. category: reference --- - # SCHEMATA The `SCHEMATA` table provides information about databases. The table data is equivalent to the result of the `SHOW DATABASES` statement. diff --git a/information-schema/information-schema-session-variables.md b/information-schema/information-schema-session-variables.md index c4ba00c22a82b..d3f4e5fa35154 100644 --- a/information-schema/information-schema-session-variables.md +++ b/information-schema/information-schema-session-variables.md @@ -4,7 +4,6 @@ summary: Learn the `SESSION_VARIABLES` information_schema table. category: reference --- - # SESSION_VARIABLES The `SESSION_VARIABLES` table provides information about session variables. The table data is similar to the result of the `SHOW SESSION VARIABLES` statement. diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index 688236ad4fc30..cc5c648b03b04 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -4,7 +4,6 @@ summary: Learn the `SLOW_QUERY` information_schema table. category: reference --- - # SLOW_QUERY The `SLOW_QUERY` table provides the slow query information of the current node, which is the parsing result of the TiDB slow log file. The column names in the table are corresponding to the field names in the slow log. For how to use this table to identify problematic statements and improve query performance, see [Slow Query Log Document](/identify-slow-queries.md). @@ -78,10 +77,9 @@ DESC slow_query; 54 rows in set (0.00 sec) ``` - ## CLUSTER_SLOW_QUERY table -The `CLUSTER_SLOW_QUERY` table provides the slow query information of all nodes in the cluster, which is the parsing result of the TiDB slow log files. You can use the `CLUSTER_SLOW_QUERY` table the way you do with [`SLOW_QUERY`](#slow_query-table). The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query. For how to use this table to identify problematic statements and improve query performance, see [Slow Query Log Document](/identify-slow-queries.md). +The `CLUSTER_SLOW_QUERY` table provides the slow query information of all nodes in the cluster, which is the parsing result of the TiDB slow log files. You can use the `CLUSTER_SLOW_QUERY` table the way you do with `SLOW_QUERY`. The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query. For how to use this table to identify problematic statements and improve query performance, see [Slow Query Log Document](/identify-slow-queries.md). {{< copyable "sql" >}} diff --git a/information-schema/information-schema-sql-diagnostics.md b/information-schema/information-schema-sql-diagnostics.md index 596852899db51..4e5f3626662d2 100644 --- a/information-schema/information-schema-sql-diagnostics.md +++ b/information-schema/information-schema-sql-diagnostics.md @@ -2,7 +2,7 @@ title: SQL Diagnostics summary: Understand SQL diagnostics in TiDB. category: reference -aliases: ['/docs/dev/system-tables/system-table-sql-diagnostics/','/docs/dev/reference/system-databases/sql-diagnosis/','/docs/dev/system-tables/system-table-sql-diagnosis/'] +aliases: ['/docs/dev/system-tables/system-table-sql-diagnostics/','/docs/dev/reference/system-databases/sql-diagnosis/','/docs/dev/system-tables/system-table-sql-diagnosis/','/tidb/dev/system-table-sql-diagnostics/'] --- # SQL Diagnostics @@ -34,12 +34,12 @@ The SQL diagnostic system consists of three major parts: The cluster information tables bring together the information of all instances and instances in a cluster. With these tables, you can query all cluster information using only one SQL statement. The following is a list of cluster information tables: -+ From the cluster topology table [`information_schema.cluster_info`](/system-tables/system-table-cluster-info.md), you can get the current topology information of the cluster, the version of each instance, the Git Hash corresponding to the version, the starting time of each instance, and the running time of each instance. -+ From the cluster configuration table [`information_schema.cluster_config`](/system-tables/system-table-cluster-config.md), you can get the configuration of all instances in the cluster. For versions earlier than 4.0, you need to access the HTTP API of each instance one by one to get these configuration information. -+ On the cluster hardware table [`information_schema.cluster_hardware`](/system-tables/system-table-cluster-hardware.md), you can quickly query the cluster hardware information. -+ On the cluster load table [`information_schema.cluster_load`](/system-tables/system-table-cluster-load.md), you can query the load information of different instances and hardware types of the cluster. -+ On the kernel parameter table [`information_schema.cluster_systeminfo`](/system-tables/system-table-cluster-systeminfo.md), you can query the kernel configuration information of different instances in the cluster. Currently, TiDB supports querying the sysctl information. -+ On the cluster log table [`information_schema.cluster_log`](/system-tables/system-table-cluster-log.md), you can query cluster logs. By pushing down query conditions to each instance, the impact of the query on cluster performance is less than that of the `grep` command. ++ From the cluster topology table [`information_schema.cluster_info`](/information-schema/information-schema-cluster-info.md), you can get the current topology information of the cluster, the version of each instance, the Git Hash corresponding to the version, the starting time of each instance, and the running time of each instance. ++ From the cluster configuration table [`information_schema.cluster_config`](/information-schema/information-schema-cluster-config.md), you can get the configuration of all instances in the cluster. For versions earlier than 4.0, you need to access the HTTP API of each instance one by one to get these configuration information. ++ On the cluster hardware table [`information_schema.cluster_hardware`](/information-schema/information-schema-cluster-hardware.md), you can quickly query the cluster hardware information. ++ On the cluster load table [`information_schema.cluster_load`](/information-schema/information-schema-cluster-load.md), you can query the load information of different instances and hardware types of the cluster. ++ On the kernel parameter table [`information_schema.cluster_systeminfo`](/information-schema/information-schema-cluster-systeminfo.md), you can query the kernel configuration information of different instances in the cluster. Currently, TiDB supports querying the sysctl information. ++ On the cluster log table [`information_schema.cluster_log`](/information-schema/information-schema-cluster-log.md), you can query cluster logs. By pushing down query conditions to each instance, the impact of the query on cluster performance is less than that of the `grep` command. On the system tables earlier than TiDB v4.0, you can only view the current instance. TiDB v4.0 introduces the corresponding cluster tables and you can have a global view of the entire cluster on a single TiDB instance. These tables are currently in `information_schema`, and the query method is the same as other `information_schema` system tables. @@ -47,16 +47,16 @@ On the system tables earlier than TiDB v4.0, you can only view the current insta To dynamically observe and compare cluster conditions in different time periods, the SQL diagnostic system introduces cluster monitoring system tables. All monitoring tables are in `metrics_schema`, and you can query the monitoring information using SQL statements. Using this method, you can perform correlated queries on all monitoring information of the entire cluster and compare the results of different time periods to quickly identify performance bottlenecks. -+ [`information_schema.metrics_tables`](/system-tables/system-table-metrics-tables.md): Because many system tables exist now, you can query meta-information of these monitoring tables on the `information_schema.metrics_tables` table. ++ [`information_schema.metrics_tables`](/information-schema/information-schema-metrics-tables.md): Because many system tables exist now, you can query meta-information of these monitoring tables on the `information_schema.metrics_tables` table. Because the TiDB cluster has many monitoring metrics, TiDB provides the following monitoring summary tables in v4.0: -+ The monitoring summary table [`information_schema.metrics_summary`](/system-tables/system-table-metrics-summary.md) summarizes all monitoring data to for you to check each monitoring metric with higher efficiency. -+ [`information_schema.metrics_summary_by_label`](/system-tables/system-table-metrics-summary.md) also summarizes all monitoring data. Particularly, this table aggregates statistics using different labels of each monitoring metric. ++ The monitoring summary table [`information_schema.metrics_summary`](/information-schema/information-schema-metrics-summary.md) summarizes all monitoring data to for you to check each monitoring metric with higher efficiency. ++ [`information_schema.metrics_summary_by_label`](/information-schema/information-schema-metrics-summary.md) also summarizes all monitoring data. Particularly, this table aggregates statistics using different labels of each monitoring metric. ## Automatic diagnostics On the cluster information tables and cluster monitoring tables above, you need to manually execute SQL statements to troubleshoot the cluster. TiDB v4.0 supports the automatic diagnostics. You can use diagnostic-related system tables based on the existing basic information tables, so that the diagnostics is automatically executed. The following are the system tables related to the automatic diagnostics: -+ The diagnostic result table [`information_schema.inspection_result`](/system-tables/system-table-inspection-result.md) displays the diagnostic result of the system. The diagnostics is passively triggered. Executing `select * from inspection_result` triggers all diagnostic rules to diagnose the system, and the faults or risks in the system are displayed in the results. -+ The diagnostic summary table [`information_schema.inspection_summary`](/system-tables/system-table-inspection-summary.md) summarizes the monitoring information of a specific link or module. You can troubleshoot and locate problems based on the context of the entire module or link. ++ The diagnostic result table [`information_schema.inspection_result`](/information-schema/information-schema-inspection-result.md) displays the diagnostic result of the system. The diagnostics is passively triggered. Executing `select * from inspection_result` triggers all diagnostic rules to diagnose the system, and the faults or risks in the system are displayed in the results. ++ The diagnostic summary table [`information_schema.inspection_summary`](/information-schema/information-schema-inspection-summary.md) summarizes the monitoring information of a specific link or module. You can troubleshoot and locate problems based on the context of the entire module or link. diff --git a/information-schema/information-schema-statistics.md b/information-schema/information-schema-statistics.md index 437e84c61a34f..ae9d54f97f9d4 100644 --- a/information-schema/information-schema-statistics.md +++ b/information-schema/information-schema-statistics.md @@ -4,7 +4,6 @@ summary: Learn the `STATISTICS` information_schema table. category: reference --- - # STATISTICS The `STATISTICS` table provides information about table indexes. diff --git a/information-schema/information-schema-table-constraints.md b/information-schema/information-schema-table-constraints.md index a57897d8c50c7..df4178b3b4133 100644 --- a/information-schema/information-schema-table-constraints.md +++ b/information-schema/information-schema-table-constraints.md @@ -4,7 +4,6 @@ summary: Learn the `TABLE_CONSTRAINTS` information_schema table. category: reference --- - # TABLE_CONSTRAINTS The `TABLE_CONSTRAINTS` table describes which tables have constraints. diff --git a/information-schema/information-schema-tables.md b/information-schema/information-schema-tables.md index 772085282f196..4ef7d891d52cb 100644 --- a/information-schema/information-schema-tables.md +++ b/information-schema/information-schema-tables.md @@ -4,7 +4,6 @@ summary: Learn the `TABLES` information_schema table. category: reference --- - # TABLES The `TABLES` table provides information about tables in databases: diff --git a/information-schema/information-schema-tidb-hot-regions.md b/information-schema/information-schema-tidb-hot-regions.md index 534bfc45513a0..8b58fe110f6e3 100644 --- a/information-schema/information-schema-tidb-hot-regions.md +++ b/information-schema/information-schema-tidb-hot-regions.md @@ -4,7 +4,6 @@ summary: Learn the `TIDB_HOT_REGIONS` information_schema table. category: reference --- - # TIDB_HOT_REGIONS The `TIDB_HOT_REGIONS` table provides information about hotspot Regions. @@ -35,5 +34,4 @@ DESC tidb_hot_regions; ``` - `TABLE_ID` and `INDEX_ID` are IDs generated for the corresponding table and index in TiDB. -- `TYPE` is the type for a hot Region. Its value can be `READ` or `WRITE`. - +- `TYPE` is the type for a hot Region. Its value can be `READ` or `WRITE`. \ No newline at end of file diff --git a/information-schema/information-schema-tidb-indexes.md b/information-schema/information-schema-tidb-indexes.md index 7fe9968fa8c61..9cf6e2b62f722 100644 --- a/information-schema/information-schema-tidb-indexes.md +++ b/information-schema/information-schema-tidb-indexes.md @@ -4,7 +4,6 @@ summary: Learn the `TIDB_INDEXES` information_schema table. category: reference --- - # TIDB_INDEXES The `TIDB_INDEXES` table provides the INDEX information of all tables. diff --git a/information-schema/information-schema-tikv-region-status.md b/information-schema/information-schema-tikv-region-status.md index 9decc5b667a94..041b249c128e1 100644 --- a/information-schema/information-schema-tikv-region-status.md +++ b/information-schema/information-schema-tikv-region-status.md @@ -8,7 +8,6 @@ category: reference The `TIKV_REGION_STATUS` table shows some basic information of TiKV Regions via PD's API, like the Region ID, starting and ending key-values, and read and write traffic. - {{< copyable "sql" >}} ```sql diff --git a/information-schema/information-schema-tikv-store-status.md b/information-schema/information-schema-tikv-store-status.md index 384863b3a009e..ffaaee7efdf1c 100644 --- a/information-schema/information-schema-tikv-store-status.md +++ b/information-schema/information-schema-tikv-store-status.md @@ -4,7 +4,6 @@ summary: Learn the `TIKV_STORE_STATUS` information_schema table. category: reference --- - # TIKV_STORE_STATUS The `TIKV_STORE_STATUS` table shows some basic information of TiKV nodes via PD's API, like the ID allocated in the cluster, address and port, and status, capacity, and the number of Region leaders of the current node. diff --git a/information-schema/information-schema-user-privileges.md b/information-schema/information-schema-user-privileges.md index 4e0538fd43e59..c621125b8be98 100644 --- a/information-schema/information-schema-user-privileges.md +++ b/information-schema/information-schema-user-privileges.md @@ -4,7 +4,6 @@ summary: Learn the `USER_PRIVILEGES` information_schema table. category: reference --- - # USER_PRIVILEGES The `USER_PRIVILEGES` table provides information about global privileges. This information comes from the `mysql.user` system table: diff --git a/metrics-schema.md b/metrics-schema.md index 9708ce6adae68..36a4f9770bef8 100644 --- a/metrics-schema.md +++ b/metrics-schema.md @@ -2,12 +2,12 @@ title: Metrics Schema summary: Learn the `METRICS_SCHEMA` schema. category: reference -aliases: ['/docs/dev/system-tables/system-table-metrics-schema/','/docs/dev/reference/system-databases/metrics-schema/'] +aliases: ['/docs/dev/system-tables/system-table-metrics-schema/','/docs/dev/reference/system-databases/metrics-schema/','/tidb/dev/system-table-metrics-schema/'] --- # Metrics Schema -The `METRICS_SCHEMA` is a set of views on top of TiDB metrics that are stored in Prometheus. The source of the PromQL (Prometheus Query Language) for each of the tables is available in [`INFORMATION_SCHEMA.METRICS_TABLES`](/informaition-schema/information-schema-metrics-tables.md). +The `METRICS_SCHEMA` is a set of views on top of TiDB metrics that are stored in Prometheus. The source of the PromQL (Prometheus Query Language) for each of the tables is available in [`INFORMATION_SCHEMA.METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md). {{< copyable "sql" >}} diff --git a/mysql-schema.md b/mysql-schema.md index 2b22065e73a4a..e5e7e4a94ff82 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -2,7 +2,7 @@ title: mysql summary: Learn about the TiDB system tables. category: reference -aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/'] +aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/','/tidb/dev/system-table-overview/'] --- # mysql diff --git a/sql-statements/sql-statement-show-analyze-status.md b/sql-statements/sql-statement-show-analyze-status.md index 4bcb76ecad3f0..0d42d29c1a266 100644 --- a/sql-statements/sql-statement-show-analyze-status.md +++ b/sql-statements/sql-statement-show-analyze-status.md @@ -47,4 +47,4 @@ show analyze status; ## See also -* [ANALYZE_STATUS table](/system-tables/system-table-information-schema.md#analyze_status-table) +* [ANALYZE_STATUS table](/information-schema/information-schema-analyze-status.md) diff --git a/whats-new-in-tidb-4.0.md b/whats-new-in-tidb-4.0.md index bf22533c7c011..27842815f49ac 100644 --- a/whats-new-in-tidb-4.0.md +++ b/whats-new-in-tidb-4.0.md @@ -60,7 +60,7 @@ TiUP is a new package manager tool introduced in v4.0 that is used to manage all - Support using the Index Merge feature to access tables. When you make a query on a single table, the TiDB optimizer automatically reads multiple index data according to the query condition and makes a union of the result, which improves the performance of querying on a single table. See [Index Merge](/index-merge.md) for details. - Support the expression index feature (**experimental**). The expression index is also called the function-based index. When you create an index, the index fields do not have to be a specific column but can be an expression calculated from one or more columns. This feature is useful for quickly accessing the calculation-based tables. See [Expression index](/sql-statements/sql-statement-create-index.md) for details. - Support `AUTO_RANDOM` keys as an extended syntax for the TiDB columnar attribute (**experimental**). `AUTO_RANDOM` is designed to address the hotspot issue caused by the auto-increment column and provides a low-cost migration solution from MySQL for users who work with auto-increment columns. See [`AUTO_RANDOM` Key](/auto-random.md) for details. -- Add system tables that provide information of cluster topology, configuration, logs, hardware, operating systems, and slow queries, which helps DBAs to quickly learn, analyze system metrics. See [SQL Diagnosis](/system-tables/system-table-sql-diagnostics.md) for details. +- Add system tables that provide information of cluster topology, configuration, logs, hardware, operating systems, and slow queries, which helps DBAs to quickly learn, analyze system metrics. See [SQL Diagnosis](/information-schema/information-schema-sql-diagnostics.md) for details. - Add system tables that provide information of cluster topology, configuration, logs, hardware, operating systems to help DBAs quickly learn the cluster configuration and status: - The `cluster_info` table that stores the cluster topology information. From fca81ca900691442c6e4553538be0d82ec1b7e73 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Tue, 7 Jul 2020 07:27:47 -0600 Subject: [PATCH 05/14] Split information_schema table --- information-schema.md | 135 ++++++++++++++++++++++-------------------- 1 file changed, 71 insertions(+), 64 deletions(-) diff --git a/information-schema.md b/information-schema.md index 4368aabdcf715..19fac819a4d81 100644 --- a/information-schema.md +++ b/information-schema.md @@ -11,67 +11,74 @@ Information Schema provides an ANSI-standard way of viewing system metadata. TiD Many `INFORMATION_SCHEMA` tables have a corresponding `SHOW` command. The benefit of querying `INFORMATION_SCHEMA` is that it is possible to join between tables. -| Table Name | TiDB Extension | Description | -|-----------------------------------------------------------------------------------------|----------------|-------------| -| [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) | Yes | Provides information about tasks to collect statistics. | -| [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) | No | Provides a list of character sets the server supports. | -| [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster-config.md) | Yes | Provides details about configuration settings for the entire TiDB cluster. | -| [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster-info.md) | Yes | Provides details on the underlying physical hardware discovered on each TiDB component. | -| [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) | Yes | Provides details on the current cluster topology. | -| [`CLUSTER_LOAD`](/information-schema/information-schema-cluster-load.md) | Yes | Provides current load information for TiDB servers in the cluster. | -| [`CLUSTER_LOG`](/information-schema/information-schema-cluster-log.md) | Yes | Provides a log for the entire TiDB cluster | -| `CLUSTER_PROCESSLIST` | Yes | Provides a cluster-level view of the `PROCESSLIST` table. | -| `CLUSTER_SLOW_QUERY` | Yes | Provides a cluster-level view of the `SLOW_QUERY` table. | -| `CLUSTER_STATEMENTS_SUMMARY` | Yes | Provides a cluster-level view of the `STATEMENTS_SUMMARY` table. | -| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | Yes | Provides a cluster-level view of the `CLUSTER_STATEMENTS_SUMMARY_HISTORY` table. | -| [`CLUSTER_SYSTEMINFO`](/information-schema/information-schema-cluster-systeminfo.md) | Yes | Provides details about kernel parameter configuration for servers in the cluster. | -| [`COLLATIONS`](/information-schema/information-schema-collations.md) | No | Provides a list of collations that the server supports. | -| [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) | No | Explains which collations apply to which character sets. | -| [`COLUMNS`](/information-schema/information-schema-columns.md) | No | Provides a list of columns for all tables. | -| `COLUMN_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | -| `COLUMN_STATISTICS` | No | Not implemented by TiDB. Returns zero rows. | -| [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) | Yes | Provides similar output to `ADMIN SHOW DDL JOBS` | -| [`ENGINES`](/information-schema/information-schema-engines.md) | No | Provides a list of supported storage engines. | -| `EVENTS` | No | Not implemented by TiDB. Returns zero rows. | -| `FILES` | No | Not implemented by TiDB. Returns zero rows. | -| `GLOBAL_STATUS` | No | Not implemented by TiDB. Returns zero rows. | -| `GLOBAL_VARIABLES` | No | Not implemented by TiDB. Returns zero rows. | -| [`INSPECTION_RESULT`](/information-schema/information-schema-inspection-result.md) | Yes | Triggers internal diagnostics checks. | -| [`INSPECTION_RULES`](/information-schema/information-schema-inspection-rules.md) | Yes | A list of internal diagnostic checks performed. | -| [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) | Yes | A summarized report of important monitoring metrics. | -| [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) | No | Describes the key constraints of the columns, such as the primary key constraint. | -| [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) | Yes | A summary of metrics extracted from Prometheus. | -| `METRICS_SUMMARY_BY_LABEL` | Yes | See `METRICS_SUMAMARY` table. | -| [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) | Yes | Provides the PromQL definitions for tables in `METRICS_SCHEMA`. | -| `OPTIMIZER_TRACE` | No | Not implemented by TiDB. Returns zero rows. | -| `PARAMETERS` | No | Not implemented by TiDB. Returns zero rows. | -| [`PARTITIONS`](/information-schema/information-schema-partitions.md) | No | Provides a list of table partitions. | -| `PLUGINS` | No | Not implemented by TiDB. Returns zero rows. | -| [`PROCESSLIST`](/information-schema/information-schema-processlist.md) | No | Provides similar information to the command `SHOW PROCESSLIST`. | -| `PROFILING` | No | Not implemented by TiDB. Returns zero rows. | -| `REFERENTIAL_CONSTRAINTS` | No | Not implemented by TiDB. Returns zero rows. | -| `ROUTINES` | No | Not implemented by TiDB. Returns zero rows. | -| [`SCHEMATA`](/information-schema/information-schema-schemata.md) | No | Provides similar information to `SHOW DATABASES`. | -| `SCHEMA_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | -| [`SEQUENCES`](/information-schema/information-schema-sequences.md) | Yes | The TiDB implementation of sequences is based on MariaDB. | -| `SESSION_STATUS` | No | Not implemented by TiDB. Returns zero rows. | -| [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) | No | Provides similar functionality to the command `SHOW SESSION VARIABLES` | -| [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) | Yes | Provides information on slow queries on the current TiDB server. | -| [`STATEMENTS_SUMMARY`](/statement-summary-tables.md) | Yes | Similar to performance_schema statement summary in MySQL. | -| [`STATEMENTS_SUMMARY_HISTORY`](/statement-summary-tables.md) | Yes | Similar to performance_schema statement summary history in MySQL. | -| [`STATISTICS`](/information-schema/information-schema-statistics.md) | No | Provides information on table indexes. | -| [`TABLES`](/information-schema/information-schema-tables.md) | No | Provides a list of tables that the current user has visibility of. Similar to `SHOW TABLES`. | -| `TABLESPACES` | No | Not implemented by TiDB. Returns zero rows. | -| [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) | No | Provides information on primary keys, unique indexes and foreign keys. | -| `TABLE_PRIVILEGES` | No | Not implemented by TiDB. Returns zero rows. | -| [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) | Yes | Provides details about table sizes in storage. | -| [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) | Yes | Provides statistics about which regions are hot. | -| [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) | Yes | Provides index information about TiDB tables. | -| [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) | Yes | Provides a list of TiDB servers (i.e. tidb-server component) | -| [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) | Yes | Provides details about TiFlash replicas. | -| [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) | Yes | Provides details about where regions are stored. | -| [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) | Yes | Provides statistics about regions. | -| [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) | Yes | Provides basic information about TiKV servers. | -| `TRIGGERS` | No | Not implemented by TiDB. Returns zero rows. | -| [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) | No | Summarizes the privileges associated with the current user. | -| [`VIEWS`](/information-schema/information-schema-views.md) | No | Provides a list of views that the current user has visibility of. Similar to running `SHOW FULL TABLES WHERE table_type = 'VIEW'` | +## Tables for MySQL compatibility + +| Table Name | Description | +|-----------------------------------------------------------------------------------------|-----------------------------| +| [`CHARACTER_SETS`](/information-schema/information-schema-character-sets.md) | Provides a list of character sets the server supports. | +| [`COLLATIONS`](/information-schema/information-schema-collations.md) | Provides a list of collations that the server supports. | +| [`COLLATION_CHARACTER_SET_APPLICABILITY`](/information-schema/information-schema-collation-character-set-applicability.md) | Explains which collations apply to which character sets. | +| [`COLUMNS`](/information-schema/information-schema-columns.md) | Provides a list of columns for all tables. | +| `COLUMN_PRIVILEGES` | Not implemented by TiDB. Returns zero rows. | +| `COLUMN_STATISTICS` | Not implemented by TiDB. Returns zero rows. | +| [`ENGINES`](/information-schema/information-schema-engines.md) | Provides a list of supported storage engines. | +| `EVENTS` | Not implemented by TiDB. Returns zero rows. | +| `FILES` | Not implemented by TiDB. Returns zero rows. | +| `GLOBAL_STATUS` | Not implemented by TiDB. Returns zero rows. | +| `GLOBAL_VARIABLES` | Not implemented by TiDB. Returns zero rows. | +| [`KEY_COLUMN_USAGE`](/information-schema/information-schema-key-column-usage.md) | Describes the key constraints of the columns, such as the primary key constraint. | +| `OPTIMIZER_TRACE` | Not implemented by TiDB. Returns zero rows. | +| `PARAMETERS` | Not implemented by TiDB. Returns zero rows. | +| [`PARTITIONS`](/information-schema/information-schema-partitions.md) | Provides a list of table partitions. | +| `PLUGINS` | Not implemented by TiDB. Returns zero rows. | +| [`PROCESSLIST`](/information-schema/information-schema-processlist.md) | Provides similar information to the command `SHOW PROCESSLIST`. | +| `PROFILING` | Not implemented by TiDB. Returns zero rows. | +| `REFERENTIAL_CONSTRAINTS` | Not implemented by TiDB. Returns zero rows. | +| `ROUTINES` | Not implemented by TiDB. Returns zero rows. | +| [`SCHEMATA`](/information-schema/information-schema-schemata.md) | Provides similar information to `SHOW DATABASES`. | +| `SCHEMA_PRIVILEGES` | Not implemented by TiDB. Returns zero rows. | +| `SESSION_STATUS` | Not implemented by TiDB. Returns zero rows. | +| [`SESSION_VARIABLES`](/information-schema/information-schema-session-variables.md) | Provides similar functionality to the command `SHOW SESSION VARIABLES` | +| [`STATISTICS`](/information-schema/information-schema-statistics.md) | Provides information on table indexes. | +| [`TABLES`](/information-schema/information-schema-tables.md) | Provides a list of tables that the current user has visibility of. Similar to `SHOW TABLES`. | +| `TABLESPACES` | Not implemented by TiDB. Returns zero rows. | +| [`TABLE_CONSTRAINTS`](/information-schema/information-schema-table-constraints.md) | Provides information on primary keys, unique indexes and foreign keys. | +| `TABLE_PRIVILEGES` | Not implemented by TiDB. Returns zero rows. | +| `TRIGGERS` | Not implemented by TiDB. Returns zero rows. | +| [`USER_PRIVILEGES`](/information-schema/information-schema-user-privileges.md) | Summarizes the privileges associated with the current user. | +| [`VIEWS`](/information-schema/information-schema-views.md) | Provides a list of views that the current user has visibility of. Similar to running `SHOW FULL TABLES WHERE table_type = 'VIEW'` | + +## Tables that are TiDB extensions + +| Table Name | Description | +|-----------------------------------------------------------------------------------------|-------------| +| [`ANALYZE_STATUS`](/information-schema/information-schema-analyze-status.md) | Provides information about tasks to collect statistics. | +| [`CLUSTER_CONFIG`](/information-schema/information-schema-cluster-config.md) | Provides details about configuration settings for the entire TiDB cluster. | +| [`CLUSTER_HARDWARE`](/information-schema/information-schema-cluster-info.md) | Provides details on the underlying physical hardware discovered on each TiDB component. | +| [`CLUSTER_INFO`](/information-schema/information-schema-cluster-info.md) | Provides details on the current cluster topology. | +| [`CLUSTER_LOAD`](/information-schema/information-schema-cluster-load.md) | Provides current load information for TiDB servers in the cluster. | +| [`CLUSTER_LOG`](/information-schema/information-schema-cluster-log.md) | Provides a log for the entire TiDB cluster | +| `CLUSTER_PROCESSLIST` | Provides a cluster-level view of the `PROCESSLIST` table. | +| `CLUSTER_SLOW_QUERY` | Provides a cluster-level view of the `SLOW_QUERY` table. | +| `CLUSTER_STATEMENTS_SUMMARY` | Provides a cluster-level view of the `STATEMENTS_SUMMARY` table. | +| `CLUSTER_STATEMENTS_SUMMARY_HISTORY` | Provides a cluster-level view of the `CLUSTER_STATEMENTS_SUMMARY_HISTORY` table. | +| [`CLUSTER_SYSTEMINFO`](/information-schema/information-schema-cluster-systeminfo.md) | Provides details about kernel parameter configuration for servers in the cluster. | +| [`DDL_JOBS`](/information-schema/information-schema-ddl-jobs.md) | Provides similar output to `ADMIN SHOW DDL JOBS` | +| [`INSPECTION_RESULT`](/information-schema/information-schema-inspection-result.md) | Triggers internal diagnostics checks. | +| [`INSPECTION_RULES`](/information-schema/information-schema-inspection-rules.md) | A list of internal diagnostic checks performed. | +| [`INSPECTION_SUMMARY`](/information-schema/information-schema-inspection-summary.md) | A summarized report of important monitoring metrics. | +| [`METRICS_SUMMARY`](/information-schema/information-schema-metrics-summary.md) | A summary of metrics extracted from Prometheus. | +| `METRICS_SUMMARY_BY_LABEL` | See `METRICS_SUMAMARY` table. | +| [`METRICS_TABLES`](/information-schema/information-schema-metrics-tables.md) | Provides the PromQL definitions for tables in `METRICS_SCHEMA`. | +| [`SEQUENCES`](/information-schema/information-schema-sequences.md) | The TiDB implementation of sequences is based on MariaDB. | +| [`SLOW_QUERY`](/information-schema/information-schema-slow-query.md) | Provides information on slow queries on the current TiDB server. | +| [`STATEMENTS_SUMMARY`](/statement-summary-tables.md) | Similar to performance_schema statement summary in MySQL. | +| [`STATEMENTS_SUMMARY_HISTORY`](/statement-summary-tables.md) | Similar to performance_schema statement summary history in MySQL. | +| [`TABLE_STORAGE_STATS`](/information-schema/information-schema-table-storage-stats.md) | Provides details about table sizes in storage. | +| [`TIDB_HOT_REGIONS`](/information-schema/information-schema-tidb-hot-regions.md) | Provides statistics about which regions are hot. | +| [`TIDB_INDEXES`](/information-schema/information-schema-tidb-indexes.md) | Provides index information about TiDB tables. | +| [`TIDB_SERVERS_INFO`](/information-schema/information-schema-tidb-servers-info.md) | Provides a list of TiDB servers (i.e. tidb-server component) | +| [`TIFLASH_REPLICA`](/information-schema/information-schema-tiflash-replica.md) | Provides details about TiFlash replicas. | +| [`TIKV_REGION_PEERS`](/information-schema/information-schema-tikv-region-peers.md) | Provides details about where regions are stored. | +| [`TIKV_REGION_STATUS`](/information-schema/information-schema-tikv-region-status.md) | Provides statistics about regions. | +| [`TIKV_STORE_STATUS`](/information-schema/information-schema-tikv-store-status.md) | Provides basic information about TiKV servers. | From 92ecf6bc447115dc363a0aa3fee31a6d235f6394 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Fri, 10 Jul 2020 09:00:23 -0600 Subject: [PATCH 06/14] Remove category meta data from files --- information-schema.md | 1 - information-schema/information-schema-analyze-status.md | 1 - information-schema/information-schema-character-sets.md | 1 - information-schema/information-schema-cluster-config.md | 1 - information-schema/information-schema-cluster-hardware.md | 1 - information-schema/information-schema-cluster-info.md | 1 - information-schema/information-schema-cluster-load.md | 1 - information-schema/information-schema-cluster-log.md | 1 - information-schema/information-schema-cluster-systeminfo.md | 1 - .../information-schema-collation-character-set-applicability.md | 1 - information-schema/information-schema-collations.md | 1 - information-schema/information-schema-columns.md | 1 - information-schema/information-schema-ddl-jobs.md | 1 - information-schema/information-schema-engines.md | 1 - information-schema/information-schema-inspection-result.md | 1 - information-schema/information-schema-inspection-rules.md | 1 - information-schema/information-schema-inspection-summary.md | 1 - information-schema/information-schema-key-column-usage.md | 1 - information-schema/information-schema-metrics-summary.md | 1 - information-schema/information-schema-metrics-tables.md | 1 - information-schema/information-schema-partitions.md | 1 - information-schema/information-schema-processlist.md | 1 - information-schema/information-schema-schemata.md | 1 - information-schema/information-schema-sequences.md | 1 - information-schema/information-schema-session-variables.md | 1 - information-schema/information-schema-slow-query.md | 1 - information-schema/information-schema-sql-diagnostics.md | 1 - information-schema/information-schema-statistics.md | 1 - information-schema/information-schema-table-constraints.md | 1 - information-schema/information-schema-table-storage-stats.md | 1 - information-schema/information-schema-tables.md | 1 - information-schema/information-schema-tidb-hot-regions.md | 1 - information-schema/information-schema-tidb-indexes.md | 1 - information-schema/information-schema-tidb-servers-info.md | 1 - information-schema/information-schema-tiflash-replica.md | 1 - information-schema/information-schema-tikv-region-peers.md | 1 - information-schema/information-schema-tikv-region-status.md | 1 - information-schema/information-schema-tikv-store-status.md | 1 - information-schema/information-schema-user-privileges.md | 1 - information-schema/information-schema-views.md | 1 - metrics-schema.md | 1 - mysql-schema.md | 1 - 42 files changed, 42 deletions(-) diff --git a/information-schema.md b/information-schema.md index 19fac819a4d81..958f4806215df 100644 --- a/information-schema.md +++ b/information-schema.md @@ -1,7 +1,6 @@ --- title: Information Schema summary: TiDB implements the ANSI-standard information_schema for viewing system metadata. -category: reference aliases: ['/docs/dev/information-schema/information-schema-information-schema/','/docs/dev/reference/system-databases/information-schema/','/tidb/dev/system-table-information-schema/'] --- diff --git a/information-schema/information-schema-analyze-status.md b/information-schema/information-schema-analyze-status.md index 6cff99b5df5d9..280329928f209 100644 --- a/information-schema/information-schema-analyze-status.md +++ b/information-schema/information-schema-analyze-status.md @@ -1,7 +1,6 @@ --- title: ANALYZE_STATUS summary: Learn the `ANALYZE_STATUS` information_schema table. -category: reference --- # ANALYZE_STATUS diff --git a/information-schema/information-schema-character-sets.md b/information-schema/information-schema-character-sets.md index b2faf21ae6387..3c7939cf5ddf8 100644 --- a/information-schema/information-schema-character-sets.md +++ b/information-schema/information-schema-character-sets.md @@ -1,7 +1,6 @@ --- title: CHARACTER_SETS summary: Learn the `CHARACTER_SETS` information_schema table. -category: reference --- # CHARACTER_SETS diff --git a/information-schema/information-schema-cluster-config.md b/information-schema/information-schema-cluster-config.md index 76c2cde839384..205dbe7cdc4fb 100644 --- a/information-schema/information-schema-cluster-config.md +++ b/information-schema/information-schema-cluster-config.md @@ -1,7 +1,6 @@ --- title: CLUSTER_CONFIG summary: Learn the `CLUSTER_CONFIG` information_schema table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-config/','/docs/dev/reference/system-databases/cluster-config/','/tidb/dev/system-table-cluster-config/'] --- diff --git a/information-schema/information-schema-cluster-hardware.md b/information-schema/information-schema-cluster-hardware.md index 5fb457c5b8129..52960722c79ac 100644 --- a/information-schema/information-schema-cluster-hardware.md +++ b/information-schema/information-schema-cluster-hardware.md @@ -1,7 +1,6 @@ --- title: CLUSTER_HARDWARE summary: Learn the `CLUSTER_HARDWARE` information_schema table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-hardware/','/docs/dev/reference/system-databases/cluster-hardware/','/tidb/dev/system-table-cluster-hardware/'] --- diff --git a/information-schema/information-schema-cluster-info.md b/information-schema/information-schema-cluster-info.md index 2a305fa383083..0c40f5d551bcc 100644 --- a/information-schema/information-schema-cluster-info.md +++ b/information-schema/information-schema-cluster-info.md @@ -1,7 +1,6 @@ --- title: CLUSTER_INFO summary: Learn the `CLUSTER_INFO` cluster topology information table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-info/','/docs/dev/reference/system-databases/cluster-info/','/tidb/dev/system-table-cluster-info/'] --- diff --git a/information-schema/information-schema-cluster-load.md b/information-schema/information-schema-cluster-load.md index 751ca423d55b2..a91cb2011a06c 100644 --- a/information-schema/information-schema-cluster-load.md +++ b/information-schema/information-schema-cluster-load.md @@ -1,7 +1,6 @@ --- title: CLUSTER_LOAD summary: Learn the `CLUSTER_LOAD` information_schema table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-load/','/docs/dev/reference/system-databases/cluster-load/','/tidb/dev/system-table-cluster-load/'] --- diff --git a/information-schema/information-schema-cluster-log.md b/information-schema/information-schema-cluster-log.md index 6d161f6984226..7e8e69ded8062 100644 --- a/information-schema/information-schema-cluster-log.md +++ b/information-schema/information-schema-cluster-log.md @@ -1,7 +1,6 @@ --- title: CLUSTER_LOG summary: Learn the `CLUSTER_LOG` information_schema table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-log/','/docs/dev/reference/system-databases/cluster-log/','/tidb/dev/system-table-cluster-log/'] --- diff --git a/information-schema/information-schema-cluster-systeminfo.md b/information-schema/information-schema-cluster-systeminfo.md index 4348da1eb9a00..13d3397e669d9 100644 --- a/information-schema/information-schema-cluster-systeminfo.md +++ b/information-schema/information-schema-cluster-systeminfo.md @@ -1,7 +1,6 @@ --- title: CLUSTER_SYSTEMINFO summary: Learn the `CLUSTER_SYSTEMINFO` kernel parameter table. -category: reference aliases: ['/docs/dev/system-tables/system-table-cluster-systeminfo/','/docs/dev/reference/system-databases/cluster-systeminfo/','/tidb/dev/system-table-cluster-systeminfo/'] --- diff --git a/information-schema/information-schema-collation-character-set-applicability.md b/information-schema/information-schema-collation-character-set-applicability.md index 98b58d2863aca..f67bdabd2dc0b 100644 --- a/information-schema/information-schema-collation-character-set-applicability.md +++ b/information-schema/information-schema-collation-character-set-applicability.md @@ -1,7 +1,6 @@ --- title: COLLATION_CHARACTER_SET_APPLICABILITY summary: Learn the `COLLATION_CHARACTER_SET_APPLICABILITY` information_schema table. -category: reference --- # COLLATION_CHARACTER_SET_APPLICABILITY diff --git a/information-schema/information-schema-collations.md b/information-schema/information-schema-collations.md index 4e14c18a5aa6f..a1f930eed3dce 100644 --- a/information-schema/information-schema-collations.md +++ b/information-schema/information-schema-collations.md @@ -1,7 +1,6 @@ --- title: COLLATIONS summary: Learn the `COLLATIONS` information_schema table. -category: reference --- # COLLATIONS diff --git a/information-schema/information-schema-columns.md b/information-schema/information-schema-columns.md index 7276faf7571b6..cfd3d8febcb2e 100644 --- a/information-schema/information-schema-columns.md +++ b/information-schema/information-schema-columns.md @@ -1,7 +1,6 @@ --- title: COLUMNS summary: Learn the `COLUMNS` information_schema table. -category: reference --- # COLUMNS diff --git a/information-schema/information-schema-ddl-jobs.md b/information-schema/information-schema-ddl-jobs.md index 030b966eabbfb..244abcdc3b63e 100644 --- a/information-schema/information-schema-ddl-jobs.md +++ b/information-schema/information-schema-ddl-jobs.md @@ -1,7 +1,6 @@ --- title: DDL_JOBS summary: Learn the `DDL_JOBS` information_schema table. -category: reference --- # DDL_JOBS diff --git a/information-schema/information-schema-engines.md b/information-schema/information-schema-engines.md index a2554f5834650..fe27f0b6e2a3f 100644 --- a/information-schema/information-schema-engines.md +++ b/information-schema/information-schema-engines.md @@ -1,7 +1,6 @@ --- title: ENGINES summary: Learn the `ENGINES` information_schema table. -category: reference --- # ENGINES diff --git a/information-schema/information-schema-inspection-result.md b/information-schema/information-schema-inspection-result.md index f326b63d73a44..86f23f3002466 100644 --- a/information-schema/information-schema-inspection-result.md +++ b/information-schema/information-schema-inspection-result.md @@ -1,7 +1,6 @@ --- title: INSPECTION_RESULT summary: Learn the `INSPECTION_RESULT` diagnostic result table. -category: reference aliases: ['/docs/dev/system-tables/system-table-inspection-result/','/docs/dev/reference/system-databases/inspection-result/','/tidb/dev/system-table-inspection-result/'] --- diff --git a/information-schema/information-schema-inspection-rules.md b/information-schema/information-schema-inspection-rules.md index 9f072f01a8586..ffcb49b95785e 100644 --- a/information-schema/information-schema-inspection-rules.md +++ b/information-schema/information-schema-inspection-rules.md @@ -1,7 +1,6 @@ --- title: INSPECTION_RULES summary: Learn the `INSPECTION_RULES` information_schema table. -category: reference --- # INSPECTION_RULES diff --git a/information-schema/information-schema-inspection-summary.md b/information-schema/information-schema-inspection-summary.md index 66fdaf459a028..73ac020752dbb 100644 --- a/information-schema/information-schema-inspection-summary.md +++ b/information-schema/information-schema-inspection-summary.md @@ -1,7 +1,6 @@ --- title: INSPECTION_SUMMARY summary: Learn the `INSPECTION_SUMMARY` inspection summary table. -category: reference aliases: ['/docs/dev/system-tables/system-table-inspection-summary/','/docs/dev/reference/system-databases/inspection-summary/','/tidb/dev/system-table-inspection-summary/'] --- diff --git a/information-schema/information-schema-key-column-usage.md b/information-schema/information-schema-key-column-usage.md index bdab89bc14cd1..fced0d73e959f 100644 --- a/information-schema/information-schema-key-column-usage.md +++ b/information-schema/information-schema-key-column-usage.md @@ -1,7 +1,6 @@ --- title: KEY_COLUMN_USAGE summary: Learn the `KEY_COLUMN_USAGE` information_schema table. -category: reference --- # KEY_COLUMN_USAGE diff --git a/information-schema/information-schema-metrics-summary.md b/information-schema/information-schema-metrics-summary.md index e7e4b9ac4962b..a9ef946fcb38a 100644 --- a/information-schema/information-schema-metrics-summary.md +++ b/information-schema/information-schema-metrics-summary.md @@ -1,7 +1,6 @@ --- title: METRICS_SUMMARY summary: Learn the `METRICS_SUMMARY` system table. -category: reference aliases: ['/docs/dev/system-tables/system-table-metrics-summary/','/docs/dev/reference/system-databases/metrics-summary/',''/tidb/dev/system-table-metrics-summary/''] --- diff --git a/information-schema/information-schema-metrics-tables.md b/information-schema/information-schema-metrics-tables.md index 0ced0e16a71ea..bfe6cf93e53fd 100644 --- a/information-schema/information-schema-metrics-tables.md +++ b/information-schema/information-schema-metrics-tables.md @@ -1,7 +1,6 @@ --- title: METRICS_TABLES summary: Learn the `METRICS_TABLES` system table. -category: reference aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/reference/system-databases/metrics-tables/',''/tidb/dev/system-table-metrics-tables/''] --- diff --git a/information-schema/information-schema-partitions.md b/information-schema/information-schema-partitions.md index 3d819119b2595..22b0d7a5b458d 100644 --- a/information-schema/information-schema-partitions.md +++ b/information-schema/information-schema-partitions.md @@ -1,7 +1,6 @@ --- title: PARTITIONS summary: Learn the `PARTITIONS` information_schema table. -category: reference --- # PARTITIONS diff --git a/information-schema/information-schema-processlist.md b/information-schema/information-schema-processlist.md index c675d3bf391f3..e6119ccc1866d 100644 --- a/information-schema/information-schema-processlist.md +++ b/information-schema/information-schema-processlist.md @@ -1,7 +1,6 @@ --- title: PROCESSLIST summary: Learn the `PROCESSLIST` information_schema table. -category: reference --- # PROCESSLIST diff --git a/information-schema/information-schema-schemata.md b/information-schema/information-schema-schemata.md index 4657674ae373c..78e29db889e45 100644 --- a/information-schema/information-schema-schemata.md +++ b/information-schema/information-schema-schemata.md @@ -1,7 +1,6 @@ --- title: SCHEMATA summary: Learn the `SCHEMATA` information_schema table. -category: reference --- # SCHEMATA diff --git a/information-schema/information-schema-sequences.md b/information-schema/information-schema-sequences.md index 3abaac5ebe94c..bd0d75c512800 100644 --- a/information-schema/information-schema-sequences.md +++ b/information-schema/information-schema-sequences.md @@ -1,7 +1,6 @@ --- title: SEQUENCES summary: Learn the `SEQUENCES` information_schema table. -category: reference --- # SEQUENCES diff --git a/information-schema/information-schema-session-variables.md b/information-schema/information-schema-session-variables.md index d3f4e5fa35154..bc8a786696b20 100644 --- a/information-schema/information-schema-session-variables.md +++ b/information-schema/information-schema-session-variables.md @@ -1,7 +1,6 @@ --- title: SESSION_VARIABLES summary: Learn the `SESSION_VARIABLES` information_schema table. -category: reference --- # SESSION_VARIABLES diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md index cc5c648b03b04..0a9bb468415e3 100644 --- a/information-schema/information-schema-slow-query.md +++ b/information-schema/information-schema-slow-query.md @@ -1,7 +1,6 @@ --- title: SLOW_QUERY summary: Learn the `SLOW_QUERY` information_schema table. -category: reference --- # SLOW_QUERY diff --git a/information-schema/information-schema-sql-diagnostics.md b/information-schema/information-schema-sql-diagnostics.md index 4e5f3626662d2..1ed93ba55ded7 100644 --- a/information-schema/information-schema-sql-diagnostics.md +++ b/information-schema/information-schema-sql-diagnostics.md @@ -1,7 +1,6 @@ --- title: SQL Diagnostics summary: Understand SQL diagnostics in TiDB. -category: reference aliases: ['/docs/dev/system-tables/system-table-sql-diagnostics/','/docs/dev/reference/system-databases/sql-diagnosis/','/docs/dev/system-tables/system-table-sql-diagnosis/','/tidb/dev/system-table-sql-diagnostics/'] --- diff --git a/information-schema/information-schema-statistics.md b/information-schema/information-schema-statistics.md index ae9d54f97f9d4..03a5d5a365ab0 100644 --- a/information-schema/information-schema-statistics.md +++ b/information-schema/information-schema-statistics.md @@ -1,7 +1,6 @@ --- title: STATISTICS summary: Learn the `STATISTICS` information_schema table. -category: reference --- # STATISTICS diff --git a/information-schema/information-schema-table-constraints.md b/information-schema/information-schema-table-constraints.md index df4178b3b4133..c7b38cad0173c 100644 --- a/information-schema/information-schema-table-constraints.md +++ b/information-schema/information-schema-table-constraints.md @@ -1,7 +1,6 @@ --- title: TABLE_CONSTRAINTS summary: Learn the `TABLE_CONSTRAINTS` information_schema table. -category: reference --- # TABLE_CONSTRAINTS diff --git a/information-schema/information-schema-table-storage-stats.md b/information-schema/information-schema-table-storage-stats.md index f62b63c6ba95e..c45515ed86e28 100644 --- a/information-schema/information-schema-table-storage-stats.md +++ b/information-schema/information-schema-table-storage-stats.md @@ -1,7 +1,6 @@ --- title: TABLE_STORAGE_STATS summary: Learn the `TABLE_STORAGE_STATS` information_schema table. -category: reference --- # TABLE_STORAGE_STATS diff --git a/information-schema/information-schema-tables.md b/information-schema/information-schema-tables.md index 4ef7d891d52cb..28dca095253fe 100644 --- a/information-schema/information-schema-tables.md +++ b/information-schema/information-schema-tables.md @@ -1,7 +1,6 @@ --- title: TABLES summary: Learn the `TABLES` information_schema table. -category: reference --- # TABLES diff --git a/information-schema/information-schema-tidb-hot-regions.md b/information-schema/information-schema-tidb-hot-regions.md index 8b58fe110f6e3..98ead5d7daa1b 100644 --- a/information-schema/information-schema-tidb-hot-regions.md +++ b/information-schema/information-schema-tidb-hot-regions.md @@ -1,7 +1,6 @@ --- title: TIDB_HOT_REGIONS summary: Learn the `TIDB_HOT_REGIONS` information_schema table. -category: reference --- # TIDB_HOT_REGIONS diff --git a/information-schema/information-schema-tidb-indexes.md b/information-schema/information-schema-tidb-indexes.md index 9cf6e2b62f722..ccc3c96216c46 100644 --- a/information-schema/information-schema-tidb-indexes.md +++ b/information-schema/information-schema-tidb-indexes.md @@ -1,7 +1,6 @@ --- title: TIDB_INDEXES summary: Learn the `TIDB_INDEXES` information_schema table. -category: reference --- # TIDB_INDEXES diff --git a/information-schema/information-schema-tidb-servers-info.md b/information-schema/information-schema-tidb-servers-info.md index 3aa46f9848830..04de17417489f 100644 --- a/information-schema/information-schema-tidb-servers-info.md +++ b/information-schema/information-schema-tidb-servers-info.md @@ -1,7 +1,6 @@ --- title: TIDB_SERVERS_INFO summary: Learn the `TIDB_SERVERS_INFO` information_schema table. -category: reference --- # TIDB_SERVERS_INFO diff --git a/information-schema/information-schema-tiflash-replica.md b/information-schema/information-schema-tiflash-replica.md index 3403aeafebdf6..38da3a3607da0 100644 --- a/information-schema/information-schema-tiflash-replica.md +++ b/information-schema/information-schema-tiflash-replica.md @@ -1,7 +1,6 @@ --- title: TIFLASH_REPLICA summary: Learn the `TIFLASH_REPLICA` information_schema table. -category: reference --- # TIFLASH_REPLICA diff --git a/information-schema/information-schema-tikv-region-peers.md b/information-schema/information-schema-tikv-region-peers.md index f5ea01159a458..0acb64d49f074 100644 --- a/information-schema/information-schema-tikv-region-peers.md +++ b/information-schema/information-schema-tikv-region-peers.md @@ -1,7 +1,6 @@ --- title: TIKV_REGION_PEERS summary: Learn the `TIKV_REGION_PEERS` information_schema table. -category: reference --- # TIKV_REGION_PEERS diff --git a/information-schema/information-schema-tikv-region-status.md b/information-schema/information-schema-tikv-region-status.md index 041b249c128e1..0f25f34ab968a 100644 --- a/information-schema/information-schema-tikv-region-status.md +++ b/information-schema/information-schema-tikv-region-status.md @@ -1,7 +1,6 @@ --- title: TIKV_REGION_STATUS summary: Learn the `TIKV_REGION_STATUS` information_schema table. -category: reference --- # TIKV_REGION_STATUS diff --git a/information-schema/information-schema-tikv-store-status.md b/information-schema/information-schema-tikv-store-status.md index ffaaee7efdf1c..98aebdd60b446 100644 --- a/information-schema/information-schema-tikv-store-status.md +++ b/information-schema/information-schema-tikv-store-status.md @@ -1,7 +1,6 @@ --- title: TIKV_STORE_STATUS summary: Learn the `TIKV_STORE_STATUS` information_schema table. -category: reference --- # TIKV_STORE_STATUS diff --git a/information-schema/information-schema-user-privileges.md b/information-schema/information-schema-user-privileges.md index c621125b8be98..4791c3c3b608f 100644 --- a/information-schema/information-schema-user-privileges.md +++ b/information-schema/information-schema-user-privileges.md @@ -1,7 +1,6 @@ --- title: USER_PRIVILEGES summary: Learn the `USER_PRIVILEGES` information_schema table. -category: reference --- # USER_PRIVILEGES diff --git a/information-schema/information-schema-views.md b/information-schema/information-schema-views.md index 046bcfe75bbe2..1eb633c126760 100644 --- a/information-schema/information-schema-views.md +++ b/information-schema/information-schema-views.md @@ -1,7 +1,6 @@ --- title: VIEWS summary: Learn the `VIEWS` information_schema table. -category: reference --- # VIEWS diff --git a/metrics-schema.md b/metrics-schema.md index 36a4f9770bef8..203c0514376b3 100644 --- a/metrics-schema.md +++ b/metrics-schema.md @@ -1,7 +1,6 @@ --- title: Metrics Schema summary: Learn the `METRICS_SCHEMA` schema. -category: reference aliases: ['/docs/dev/system-tables/system-table-metrics-schema/','/docs/dev/reference/system-databases/metrics-schema/','/tidb/dev/system-table-metrics-schema/'] --- diff --git a/mysql-schema.md b/mysql-schema.md index e5e7e4a94ff82..0174a09c13a4a 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -1,7 +1,6 @@ --- title: mysql summary: Learn about the TiDB system tables. -category: reference aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/','/tidb/dev/system-table-overview/'] --- From 700379cf735e6f9fa927c53a3e793fee6efb5d08 Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:55:25 -0600 Subject: [PATCH 07/14] Update .github/assign-by-files.yml Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- .github/assign-by-files.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/assign-by-files.yml b/.github/assign-by-files.yml index 0a01821654b35..83f456879e52b 100644 --- a/.github/assign-by-files.yml +++ b/.github/assign-by-files.yml @@ -83,9 +83,9 @@ # - TomShawn # - -# 'information-schema/**/*.md': -# - TomShawn -# - +'information-schema/**/*.md': + - TomShawn + - nullnotnil 'ticdc/**/*.md': - WangXiangUSTC From 24eacc9aad0a91c904e1b0cef30c7cf074210c3d Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:55:47 -0600 Subject: [PATCH 08/14] Update information-schema.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- information-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/information-schema.md b/information-schema.md index 958f4806215df..677fe061aa2c1 100644 --- a/information-schema.md +++ b/information-schema.md @@ -1,7 +1,7 @@ --- title: Information Schema summary: TiDB implements the ANSI-standard information_schema for viewing system metadata. -aliases: ['/docs/dev/information-schema/information-schema-information-schema/','/docs/dev/reference/system-databases/information-schema/','/tidb/dev/system-table-information-schema/'] +aliases: ['/docs/dev/system-tables/system-table-information-schema/','/docs/dev/reference/system-databases/information-schema/','/tidb/dev/system-table-information-schema/'] --- # Information Schema From b7891063da8665794b8673039687bf176bc6687e Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:55:57 -0600 Subject: [PATCH 09/14] Update information-schema/information-schema-metrics-tables.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- information-schema/information-schema-metrics-tables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/information-schema/information-schema-metrics-tables.md b/information-schema/information-schema-metrics-tables.md index bfe6cf93e53fd..b49e2378dbd60 100644 --- a/information-schema/information-schema-metrics-tables.md +++ b/information-schema/information-schema-metrics-tables.md @@ -1,7 +1,7 @@ --- title: METRICS_TABLES summary: Learn the `METRICS_TABLES` system table. -aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/reference/system-databases/metrics-tables/',''/tidb/dev/system-table-metrics-tables/''] +aliases: ['/docs/dev/system-tables/system-table-metrics-tables/','/docs/dev/reference/system-databases/metrics-tables/','/tidb/dev/system-table-metrics-tables/'] --- # METRICS_TABLES @@ -73,4 +73,4 @@ TABLE_NAME: etcd_wal_fsync_total_time QUANTILE: 0 COMMENT: The total time of writing WAL into the persistent storage 5 rows in set (0.00 sec) -``` \ No newline at end of file +``` From 55a80c84e809bc9e9a676c1d934f13b7ee0fd3b9 Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:56:09 -0600 Subject: [PATCH 10/14] Update mysql-schema.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- mysql-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-schema.md b/mysql-schema.md index 0174a09c13a4a..c7256319a1577 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -4,7 +4,7 @@ summary: Learn about the TiDB system tables. aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/','/tidb/dev/system-table-overview/'] --- -# mysql +# `mysql` schema The `mysql` schema contains TiDB system tables. The design is similar to the `mysql` schema in MySQL, where tables such as `mysql.user` can be edited directly. It also contains a number of tables which are extensions to MySQL. From a896b10679766203f9e997c161cd72b83efa9648 Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:56:40 -0600 Subject: [PATCH 11/14] Update mysql-schema.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- mysql-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-schema.md b/mysql-schema.md index c7256319a1577..baa678c92ed5a 100644 --- a/mysql-schema.md +++ b/mysql-schema.md @@ -1,5 +1,5 @@ --- -title: mysql +title: `mysql` schema summary: Learn about the TiDB system tables. aliases: ['/docs/dev/system-tables/system-table-overview/','/docs/dev/reference/system-databases/mysql/','/tidb/dev/system-table-overview/'] --- From 68fa01d2fc8f09ce199a1f47d447f810a6a74d84 Mon Sep 17 00:00:00 2001 From: Nullnotnil Date: Sun, 19 Jul 2020 19:52:17 -0600 Subject: [PATCH 12/14] Manual merge conflicts from master --- .../information-schema-tidb-indexes.md | 12 ++++++++++++ .../information-schema-user-privileges.md | 9 ++++++++- information-schema/information-schema-views.md | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/information-schema/information-schema-tidb-indexes.md b/information-schema/information-schema-tidb-indexes.md index ccc3c96216c46..ca62404bd2705 100644 --- a/information-schema/information-schema-tidb-indexes.md +++ b/information-schema/information-schema-tidb-indexes.md @@ -48,3 +48,15 @@ WHERE AND tables.tidb_table_id = ? AND index_id = ? ``` + +Fields in the `TIDB_INDEXES` table are described as follows: + +* `TABLE_SCHEMA`: The name of the schema to which the index belongs. +* `TABLE_NAME`: The name of the table to which the index belongs. +* `NON_UNIQUE`: If the index is unique, the value is `0`; otherwise, the value is `1`. +* `KEY_NAME`: The index name. If the index is the primary key, the name is `PRIMARY`. +* `SEQ_IN_INDEX`: The sequential number of columns in the index, which starts from `1`. +* `COLUMN_NAME`: The name of the column where the index is located. +* `SUB_PART`: The prefix length of the index. If the the column is partly indexed, the `SUB_PART` value is the count of the indexed characters; otherwise, the value is `NULL`. +* `INDEX_COMMENT`: The comment of the index, which is made when the index is created. +* `INDEX_ID`: The index ID. \ No newline at end of file diff --git a/information-schema/information-schema-user-privileges.md b/information-schema/information-schema-user-privileges.md index 4791c3c3b608f..92d5dabba5d5b 100644 --- a/information-schema/information-schema-user-privileges.md +++ b/information-schema/information-schema-user-privileges.md @@ -66,4 +66,11 @@ SELECT * FROM user_privileges; | 'root'@'%' | def | CONFIG | YES | +------------+---------------+-------------------------+--------------+ 28 rows in set (0.00 sec) -``` \ No newline at end of file +``` + +Fields in the `USER_PRIVILEGES` table are described as follows: + +* `GRANTEE`: The name of the granted user, which is in the format of `'user_name'@'host_name'`. +* `TABLE_CATALOG`: The name of the catalog to which the table belongs. This value is always `def`. +* `PRIVILEGE_TYPE`: The privilege type to be granted. Only one privilege type is shown in each row. +* `IS_GRANTABLE`: If you have the `GRANT OPTION` privilege, the value is `YES`; otherwise, the value is `NO`. \ No newline at end of file diff --git a/information-schema/information-schema-views.md b/information-schema/information-schema-views.md index 1eb633c126760..eac14934e527e 100644 --- a/information-schema/information-schema-views.md +++ b/information-schema/information-schema-views.md @@ -52,4 +52,17 @@ SELECT * FROM views\G CHARACTER_SET_CLIENT: utf8mb4 COLLATION_CONNECTION: utf8mb4_0900_ai_ci 1 row in set (0.00 sec) -``` \ No newline at end of file +``` + +Fields in the `VIEWS` table are described as follows: + +* `TABLE_CATALOG`: The name of the catalog to which the view belongs. This value is always `def`. +* `TABLE_SCHEMA`: The name of the schema to which the view belongs. +* `TABLE_NAME`: The view name. +* `VIEW_DEFINITION`: The definition of view, which is made by the `SELECT` statement when the view is created. +* `CHECK_OPTION`: The `CHECK_OPTION` value. The value options are `NONE`, `CASCADE`, and `LOCAL`. +* `IS_UPDATABLE`: Whether `UPDATE`/`INSERT`/`DELETE` is applicable to the view. In TiDB, the value is always `NO`. +* `DEFINER`: The name of the user who creates the view, which is in the format of `'user_name'@'host_name'`. +* `SECURITY_TYPE`: The value of `SQL SECURITY`. The value options are `DEFINER` and `INVOKER`. +* `CHARACTER_SET_CLIENT`: The value of the `character_set_client` session variable when the view is created. +* `COLLATION_CONNECTION`: The value of the `collation_connection` session variable when the view is created. \ No newline at end of file From 16979046ffc5c2b16822b65827725eef9c4aa45e Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Mon, 20 Jul 2020 12:38:04 -0600 Subject: [PATCH 13/14] Update information-schema/information-schema-collations.md Co-authored-by: Zhang Jian --- information-schema/information-schema-collations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/information-schema/information-schema-collations.md b/information-schema/information-schema-collations.md index a1f930eed3dce..5196b77c49090 100644 --- a/information-schema/information-schema-collations.md +++ b/information-schema/information-schema-collations.md @@ -5,7 +5,7 @@ summary: Learn the `COLLATIONS` information_schema table. # COLLATIONS -The `COLLATIONS` table provides a list of collations that correspond to character sets in the `CHARACTER_SETS` table. Currently this table is included only for compatibility with MySQL. +The `COLLATIONS` table provides a list of collations that correspond to character sets in the `CHARACTER_SETS` table. Currently, this table is included only for compatibility with MySQL. {{< copyable "sql" >}} @@ -41,4 +41,4 @@ SELECT * FROM collations WHERE character_set_name='utf8mb4'; | utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 | +----------------+--------------------+------+------------+-------------+---------+ 1 row in set (0.00 sec) -``` \ No newline at end of file +``` From d57ec783ba976770f924a9d59c2e4c49cafddeb0 Mon Sep 17 00:00:00 2001 From: Null not nil <67764674+nullnotnil@users.noreply.github.com> Date: Mon, 20 Jul 2020 12:38:16 -0600 Subject: [PATCH 14/14] Update information-schema/information-schema-collation-character-set-applicability.md Co-authored-by: Zhang Jian --- ...nformation-schema-collation-character-set-applicability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/information-schema/information-schema-collation-character-set-applicability.md b/information-schema/information-schema-collation-character-set-applicability.md index f67bdabd2dc0b..67ee8ac0ae684 100644 --- a/information-schema/information-schema-collation-character-set-applicability.md +++ b/information-schema/information-schema-collation-character-set-applicability.md @@ -5,7 +5,7 @@ summary: Learn the `COLLATION_CHARACTER_SET_APPLICABILITY` information_schema ta # COLLATION_CHARACTER_SET_APPLICABILITY -The `COLLATION_CHARACTER_SET_APPLICABILITY` table maps collations to the applicable character set name. Similar to the `COLLATIONS` table, it is included only for compatibility with MySQL. +The `COLLATION_CHARACTER_SET_APPLICABILITY` table maps collations to the applicable character set name. Similar to the `COLLATIONS` table, it is included only for compatibility with MySQL. {{< copyable "sql" >}} @@ -37,4 +37,4 @@ SELECT * FROM collation_character_set_applicability WHERE character_set_name='ut | utf8mb4_bin | utf8mb4 | +----------------+--------------------+ 1 row in set (0.00 sec) -``` \ No newline at end of file +```