From 1964f79f36ba5d579327a151e0cb77fd79a5e4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 10 May 2024 12:31:19 +0200 Subject: [PATCH 01/31] Replace sqlgram links --- TOC-tidb-cloud.md | 1 + TOC.md | 1 + basic-sql-operations.md | 2 +- develop/dev-guide-create-table.md | 4 +++- develop/dev-guide-tidb-crud-sql.md | 4 ++-- expression-syntax.md | 2 +- mysql-compatibility.md | 4 +--- sql-statements/sql-statement-overview.md | 3 +++ 8 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 sql-statements/sql-statement-overview.md diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 27e0234bb1137..27a286811e73d 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -348,6 +348,7 @@ - [Expression Syntax](/expression-syntax.md) - [Comment Syntax](/comment-syntax.md) - SQL Statements + - [Overview](/sql-statements/sql-statement-overview.md) - [`ADD COLUMN`](/sql-statements/sql-statement-add-column.md) - [`ADD INDEX`](/sql-statements/sql-statement-add-index.md) - [`ADMIN`](/sql-statements/sql-statement-admin.md) diff --git a/TOC.md b/TOC.md index 7e64f636574dc..ccde041be274a 100644 --- a/TOC.md +++ b/TOC.md @@ -717,6 +717,7 @@ - [Expression Syntax](/expression-syntax.md) - [Comment Syntax](/comment-syntax.md) - SQL Statements + - [Overview](/sql-statements/sql-statement-overview.md) - [`ADD COLUMN`](/sql-statements/sql-statement-add-column.md) - [`ADD INDEX`](/sql-statements/sql-statement-add-index.md) - [`ADMIN`](/sql-statements/sql-statement-admin.md) diff --git a/basic-sql-operations.md b/basic-sql-operations.md index 6bd04f4324776..ff9ee11fe451a 100644 --- a/basic-sql-operations.md +++ b/basic-sql-operations.md @@ -14,7 +14,7 @@ To experiment with SQL and test out TiDB compatibility with MySQL queries, you c -This page walks you through the basic TiDB SQL statements such as DDL, DML and CRUD operations. For a complete list of TiDB statements, see [TiDB SQL Syntax Diagram](https://pingcap.github.io/sqlgram/). +This page walks you through the basic TiDB SQL statements such as DDL, DML and CRUD operations. For a complete list of TiDB statements, see [TiDB SQL Syntax](/sql-statements/sql-statement-overview.md)). ## Category diff --git a/develop/dev-guide-create-table.md b/develop/dev-guide-create-table.md index 058828e5a82f5..45f903957ab0e 100644 --- a/develop/dev-guide-create-table.md +++ b/develop/dev-guide-create-table.md @@ -183,7 +183,7 @@ CREATE TABLE `bookshop`.`ratings` ( ); ``` -In addition, if the current time is also filled in by default when the data is being updated, the following statements can be used (but only the [current time related statements](https://pingcap.github.io/sqlgram/#NowSymOptionFraction) can be filled in after `ON UPDATE`, and [more options](https://pingcap.github.io/sqlgram/#DefaultValueExpr) are supported after `DEFAULT`): +In addition, if the current time is also filled in by default when the data is being updated, the following statements can be used (but only the current time related statements can be filled in after `ON UPDATE`): ```sql CREATE TABLE `bookshop`.`ratings` ( @@ -195,6 +195,8 @@ CREATE TABLE `bookshop`.`ratings` ( ); ``` +See [default values](/data-type-default-values.md) for more details on what default values are supported for what datatypes. + ### Prevent duplicate values If you need to prevent duplicate values in a column, you can use the `UNIQUE` constraint. diff --git a/develop/dev-guide-tidb-crud-sql.md b/develop/dev-guide-tidb-crud-sql.md index 9fa4493e245f6..38f2242968696 100644 --- a/develop/dev-guide-tidb-crud-sql.md +++ b/develop/dev-guide-tidb-crud-sql.md @@ -21,7 +21,7 @@ TiDB is compatible with MySQL, you can use MySQL statements directly in most cas To experiment with SQL and test out TiDB compatibility with MySQL queries, you can try [TiDB Playground](https://play.tidbcloud.com/?utm_source=docs&utm_medium=basic-sql-operations). You can also first deploy a TiDB cluster and then run SQL statements in it. -This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [TiDB SQL Syntax Diagram](https://pingcap.github.io/sqlgram/). +This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [TiDB SQL Statement Overview](/sql-statements/sql-statement-overview.md). ## Category @@ -35,7 +35,7 @@ SQL is divided into the following 4 types according to their functions: - **DCL (Data Control Language)**: It is used to define access privileges and security levels. -The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [TiDB SQL syntax detailed explanation](https://pingcap.github.io/sqlgram/). +The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [TiDB SQL Statement Overview](/sql-statements/sql-statement-overview.md). ## Data Manipulation Language diff --git a/expression-syntax.md b/expression-syntax.md index fe5fae943a5ba..8cc7e4aeadbd8 100644 --- a/expression-syntax.md +++ b/expression-syntax.md @@ -18,7 +18,7 @@ The expressions can be divided into the following types: - ParamMarker (`?`), system variables, user variables and CASE expressions. -The following rules are the expression syntax, which is based on the [`parser.y`](https://github.com/pingcap/tidb/blob/master/pkg/parser/parser.y) rules of TiDB parser. For the navigable version of the following syntax diagram, refer to [TiDB SQL Syntax Diagram](https://pingcap.github.io/sqlgram/#Expression). +The following rules are the expression syntax, which is based on the [`parser.y`](https://github.com/pingcap/tidb/blob/master/pkg/parser/parser.y) rules of TiDB parser. ```ebnf+diagram Expression ::= diff --git a/mysql-compatibility.md b/mysql-compatibility.md index 0851074746c9a..39694ec6c8931 100644 --- a/mysql-compatibility.md +++ b/mysql-compatibility.md @@ -158,9 +158,7 @@ For more information, refer to [Understand the Query Execution Plan](/explain-ov ### Built-in functions -TiDB supports most of the built-in functions in MySQL, but not all. You can use the statement `SHOW BUILTINS` to get a list of the available functions. - -For more information, refer to the [TiDB SQL Grammar](https://pingcap.github.io/sqlgram/#functioncallkeyword). +TiDB supports most of the built-in functions in MySQL, but not all. You can use the statement [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) to get a list of the available functions. ### DDL operations diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md new file mode 100644 index 0000000000000..2f38006f56e09 --- /dev/null +++ b/sql-statements/sql-statement-overview.md @@ -0,0 +1,3 @@ +# SQL Statement Overview + +TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are extended with MySQL and TiDB specific statements where required. \ No newline at end of file From 240deae9ead98876ff19773f7866cb3a9865e613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 10 May 2024 13:13:48 +0200 Subject: [PATCH 02/31] Update develop/dev-guide-create-table.md Co-authored-by: kennytm --- develop/dev-guide-create-table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop/dev-guide-create-table.md b/develop/dev-guide-create-table.md index 45f903957ab0e..88e7cdbd3bb25 100644 --- a/develop/dev-guide-create-table.md +++ b/develop/dev-guide-create-table.md @@ -183,7 +183,7 @@ CREATE TABLE `bookshop`.`ratings` ( ); ``` -In addition, if the current time is also filled in by default when the data is being updated, the following statements can be used (but only the current time related statements can be filled in after `ON UPDATE`): +In addition, if the current time is also filled in by default when the data is being updated, the following statements can be used (but only the current-time related expressions can be filled in after `ON UPDATE`): ```sql CREATE TABLE `bookshop`.`ratings` ( From 9b34de6c0c49f3120d336519d54d3ff97fa03760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 22 May 2024 08:41:19 +0200 Subject: [PATCH 03/31] Update SQL Statement Overview --- sql-statements/sql-statement-overview.md | 236 ++++++++++++++++++++++- 1 file changed, 235 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 2f38006f56e09..c3b98e725803d 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -1,3 +1,237 @@ # SQL Statement Overview -TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are extended with MySQL and TiDB specific statements where required. \ No newline at end of file +TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are extended with MySQL and TiDB specific statements where required. + +## Schema management / Data definition statements (DDL) + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER DATABASE`](/sql-statements/sql-statement-alter-database.md) | Modifies a database. | +| [`ALTER SEQUENCE`](/sql-statements/sql-statement-alter-sequence.md) | Modifies a sequence. | +| [`ALTER TABLE ... ADD COLUMN`](/sql-statements/sql-statement-add-column.md) | Adds a column to an existing table. | +| [`ALTER TABLE ... ADD INDEX`](/sql-statements/sql-statement-add-index.md) | Adds an index to an existing table. | +| [`ALTER TABLE ... ALTER INDEX`](/sql-statements/sql-statement-alter-index.md) | Changes an index definition. | +| [`ALTER TABLE ... CHANGE COLUMN`](/sql-statements/sql-statement-change-column.md) | Changes a column definition. | +| [`ALTER TABLE ... COMPACT`](/sql-statements/sql-statement-alter-table-compact.md) | Compacts a table. | +| [`ALTER TABLE ... DROP COLUMN`](/sql-statements/sql-statement-drop-column.md) | Drops a column from a table. | +| [`ALTER TABLE ... MODIFY COLUMN`](/sql-statements/sql-statement-modify-column.md) | Modifies a column definition. | +| [`ALTER TABLE ... RENAME INDEX`](/sql-statements/sql-statement-rename-index.md) | Renames an index. | +| [`ALTER TABLE`](/sql-statements/sql-statement-alter-table.md) | Changes a table definition. | +| [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) | Creates a new database. | +| [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md) | Creates a new index on a table. | +| [`CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) | Creates a new sequence object. | +| [`CREATE TABLE LIKE`](/sql-statements/sql-statement-create-table-like.md) | Creates a table that is like another table. | +| [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) | Creates a new table. | +| [`CREATE VIEW`](/sql-statements/sql-statement-create-view.md) | Creates a new view. | +| [`DROP DATABASE`](/sql-statements/sql-statement-drop-database.md) | Drops an existing database. | +| [`DROP INDEX`](/sql-statements/sql-statement-drop-index.md) | Drops an index from a table. | +| [`DROP SEQUENCE`](/sql-statements/sql-statement-drop-sequence.md) | Drops a sequence object. | +| [`DROP TABLE`](/sql-statements/sql-statement-drop-table.md) | Drops an existing table. | +| [`DROP VIEW`](/sql-statements/sql-statement-drop-view.md) | Drops an existing view. | +| [`RENAME TABLE`](/sql-statements/sql-statement-rename-table.md) | Renames a table. | +| [`SHOW COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) | Shows the columns from a table. | +| [`SHOW CREATE DATABASE`](/sql-statements/sql-statement-show-create-database.md) | Shows the CREATE statement for a database. | +| [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) | Shows the CREATE statement for a sequence. | +| [`SHOW CREATE TABLE`](/sql-statements/sql-statement-show-create-table.md) | Shows the CREATE statement for a table. | +| [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) | Shows all databases. | +| [`SHOW FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md) | Shows columns of a table. | +| [`SHOW INDEXES`](/sql-statements/sql-statement-show-indexes.md) | Shows indexes of a table. | +| [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) | Shows all schemas. | +| [`SHOW TABLE NEXT_ROW_ID`](/sql-statements/sql-statement-show-table-next-rowid.md) | Shows the next row ID for a table. | +| [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) | Shows regions of a table. | +| [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) | Shows the status of tables. | +| [`SHOW TABLES`](/sql-statements/sql-statement-show-tables.md) | Shows tables in a database. | +| [`TRUNCATE`](/sql-statements/sql-statement-truncate.md) | Truncates all data from a table. | + +## Data manipulation statements (DML) + +| SQL Statement | Description | +|---------------|-------------| +| [`BATCH`](/sql-statements/sql-statement-batch.md) | Batches DML operations on a table. | +| [`DELETE`](/sql-statements/sql-statement-delete.md) | Deletes rows from a table. | +| [`INSERT`](/sql-statements/sql-statement-insert.md) | Inserts new rows into a table. | +| [`REPLACE`](/sql-statements/sql-statement-replace.md) | Replaces existing rows or inserts new rows. | +| [`SELECT`](/sql-statements/sql-statement-select.md) | Retrieves rows from a table. | +| [`TABLE`](/sql-statements/sql-statement-table.md) | Retrieves rows from a table. | +| [`UPDATE`](/sql-statements/sql-statement-update.md) | Updates existing rows in a table. | +| [`WITH`](/sql-statements/sql-statement-with.md) | Defines common table expressions. | + +## Transaction statements + +| SQL Statement | Description | +|---------------|-------------| +| [`BEGIN`](/sql-statements/sql-statement-begin.md) | Begins a new transaction. | +| [`COMMIT`](/sql-statements/sql-statement-commit.md) | Commits the current transaction. | +| [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) | Rolls back the current transaction. | +| [`SAVEPOINT`](/sql-statements/sql-statement-savepoint.md) | Sets a savepoint within a transaction. | +| [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) | Sets the characteristics of the current transaction. | +| [`START TRANSACTION`](/sql-statements/sql-statement-start-transaction.md) | Starts a new transaction. | + +## Prepared statements + +| SQL Statement | Description | +|---------------|-------------| +| [`DEALLOCATE`](/sql-statements/sql-statement-deallocate.md) | Deallocates a previously prepared statement. | +| [`EXECUTE`](/sql-statements/sql-statement-execute.md) | Executes a previously prepared statement. | +| [`PREPARE`](/sql-statements/sql-statement-prepare.md) | Prepares a statement for execution. | + +## Administrative statements + +| SQL Statement | Description | +|---------------|-------------| +| [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | +| [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | +| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | +| [`ADMIN CLEANUP`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up residual files or resources. | +| [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | +| [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | +| [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | +| [`ADMIN SHOW TELEMETRY`](/sql-statements/sql-statement-admin-show-telemetry.md) | Shows telemetry data. | +| [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | +| [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | +| [`SET NAMES`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | +| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | + +## Data import and export + +| SQL Statement | Description | +|---------------|-------------| +| [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) | Cancels an ongoing import job. | +| [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) | Imports data into a table from an external source. | +| [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) | Loads data into a table from a file. | +| [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) | Shows the status of an import job. | + +## Backup & restore + +| SQL Statement | Description | +|---------------|-------------| +| [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers a damaged index. | +| [`BACKUP`](/sql-statements/sql-statement-backup.md) | Creates a backup of the database. | +| [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a previous state. | +| [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores the database to a previous state. | +| [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restores a table to a previous state. | +| [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a table. | +| [`RESTORE`](/sql-statements/sql-statement-restore.md) | Restores a database from a backup. | +| [`SHOW BACKUPS`](/sql-statements/sql-statement-show-backups.md) | Shows backups. | + +## Placement policy + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER PLACEMENT POLICY`](/sql-statements/sql-statement-alter-placement-policy.md) | Modifies a placement policy. | +| [`ALTER RANGE`](/sql-statements/sql-statement-alter-range.md) | Modifies the range of a placement policy. | +| [`CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-create-placement-policy.md) | Creates a new placement policy. | +| [`DROP PLACEMENT POLICY`](/sql-statements/sql-statement-drop-placement-policy.md) | Drops an existing placement policy. | +| [`SHOW CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-show-create-placement-policy.md) | Shows the CREATE statement for a placement policy. | +| [`SHOW PLACEMENT FOR`](/sql-statements/sql-statement-show-placement-for.md) | Shows placement rules for a specific table. | +| [`SHOW PLACEMENT LABELS`](/sql-statements/sql-statement-show-placement-labels.md) | Shows available placement labels. | +| [`SHOW PLACEMENT`](/sql-statements/sql-statement-show-placement.md) | Shows placement rules. | + +## Resource groups + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | +| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Calibrates system resources. | +| [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | +| [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | +| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | +| [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | +| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the CREATE statement for a resource group. | + +## Utility statements + +| SQL Statement | Description | +|---------------|-------------| +| [`DESC`](/sql-statements/sql-statement-desc.md) | Describes the structure of a table. | +| [`DESCRIBE`](/sql-statements/sql-statement-describe.md) | Describes the structure of a table. | +| [`DO`](/sql-statements/sql-statement-do.md) | Executes an expression. | +| [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Shows the execution plan of a query. | +| [`TRACE`](/sql-statements/sql-statement-trace.md) | Traces query execution. | +| [`USE`](/sql-statements/sql-statement-use.md) | Sets the current database. | + +## Show statements + +| SQL Statement | Description | +|---------------|-------------| +| [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) | Lists builtin functions. | +| [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) | Lists character sets. | +| [`SHOW COLLATIONS`](/sql-statements/sql-statement-show-collation.md) | Lists collations. | +| [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows error messages. | +| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Shows server status. | +| [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | +| [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warning messages. | + +## Instance management + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Resets status variables. | +| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a process. | +| [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration. | +| [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | +| [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | +| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows active threads. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | +| [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Shuts down the database server. | + +## Locking statements + +| SQL Statement | Description | +|---------------|-------------| +| [`LOCK STATS`](/sql-statements/sql-statement-lock-stats.md) | Locks statistics for a table. | +| [`LOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | Locks tables for the current session. | +| [`UNLOCK STATS`](/sql-statements/sql-statement-unlock-stats.md) | Unlocks statistics for a table. | +| [`UNLOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | Unlocks tables. | + +## Account management / Data Control Language + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER USER`](/sql-statements/sql-statement-alter-user.md) | Modifies a user. | +| [`CREATE ROLE`](/sql-statements/sql-statement-create-role.md) | Creates a role. | +| [`CREATE USER`](/sql-statements/sql-statement-create-user.md) | Creates a new user. | +| [`DROP ROLE`](/sql-statements/sql-statement-drop-role.md) | Drops an existing role. | +| [`DROP USER`](/sql-statements/sql-statement-drop-user.md) | Drops an existing user. | +| [`FLUSH PRIVILEGES`](/sql-statements/sql-statement-flush-privileges.md) | Activates privilege changes. | +| [`GRANT `](/sql-statements/sql-statement-grant-privileges.md) | Grants privileges. | +| [`GRANT `](/sql-statements/sql-statement-grant-role.md) | Grants a role. | +| [`RENAME USER`](/sql-statements/sql-statement-rename-user.md) | Renames an existing user. | +| [`REVOKE `](/sql-statements/sql-statement-revoke-privileges.md) | Revokes privileges. | +| [`REVOKE `](/sql-statements/sql-statement-revoke-role.md) | Revokes a role. | +| [`SET DEFAULT ROLE`](/sql-statements/sql-statement-set-default-role.md) | Sets a default role. | +| [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) | Changes a password. | +| [`SET ROLE`](/sql-statements/sql-statement-set-role.md) | Sets a role. | +| [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) | Shows the CREATE statement for a user. | +| [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows grants for a user. | +| [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) | Shows available privileges. | + +## TiDB Binlog & TiCDC + +| SQL Statement | Description | +|---------------|-------------| +| [`ADMIN [SET\|SHOW\|UNSET] BDR ROLE`](/sql-statements/sql-statement-admin-bdr-role.md) | Manages BDR roles. | +| [`CHANGE DRAINER`](/sql-statements/sql-statement-change-drainer.md) | Changes drainer. | +| [`CHANGE PUMP`](/sql-statements/sql-statement-change-pump.md) | Changes pump. | +| [`SHOW DRAINER STATUS`](/sql-statements/sql-statement-show-drainer-status.md) | Shows the status of the drainer. | +| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the status of the master server. | +| [`SHOW PUMP STATUS`](/sql-statements/sql-statement-show-pump-status.md) | Shows the status of the pump. | + +## Statistics and plan management + +| SQL Statement | Description | +|---------------|-------------| +| [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) | Collects statistics about a table. | +| [`CREATE BINDING`](/sql-statements/sql-statement-create-binding.md) | Creates a plan binding. | +| [`DROP BINDING`](/sql-statements/sql-statement-drop-binding.md) | Drops a plan binding. | +| [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) | Drops statistics from a table. | +| [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Analyze query execution. | +| [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Load statistics. | +| [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Show analyze status. | +| [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Show bindings. | +| [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) | Shows the health of statistics. | +| [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) | Shows statistics histograms. | +| [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) | Shows locked statistics. | +| [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) | Shows metadata statistics. | \ No newline at end of file From 902fa71a2993f836fe4b74e1c586a520571a8fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 22 May 2024 08:56:21 +0200 Subject: [PATCH 04/31] Update for TiDB Cloud --- sql-statements/sql-statement-overview.md | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index c3b98e725803d..e820ee9411ed0 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -77,6 +77,8 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex ## Administrative statements + + | SQL Statement | Description | |---------------|-------------| | [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | @@ -93,6 +95,27 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SET NAMES`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | + + + + +| SQL Statement | Description | +|---------------|-------------| +| [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | +| [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | +| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | +| [`ADMIN CLEANUP`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up residual files or resources. | +| [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | +| [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | +| [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | +| [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | +| [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | +| [`SET NAMES`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | +| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | + + + ## Data import and export | SQL Statement | Description | @@ -130,6 +153,8 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex ## Resource groups + + | SQL Statement | Description | |---------------|-------------| | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | @@ -140,6 +165,21 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | | [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the CREATE statement for a resource group. | + + + + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | +| [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | +| [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | +| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | +| [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | +| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the CREATE statement for a resource group. | + + + ## Utility statements | SQL Statement | Description | @@ -165,6 +205,8 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex ## Instance management + + | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | @@ -177,6 +219,23 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | | [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Shuts down the database server. | + + + + +| SQL Statement | Description | +|---------------|-------------| +| [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Resets status variables. | +| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a process. | +| [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | +| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the status of the master server. | +| [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | +| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows active threads. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | + + + ## Locking statements | SQL Statement | Description | @@ -208,6 +267,8 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows grants for a user. | | [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) | Shows available privileges. | + + ## TiDB Binlog & TiCDC | SQL Statement | Description | @@ -219,6 +280,8 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the status of the master server. | | [`SHOW PUMP STATUS`](/sql-statements/sql-statement-show-pump-status.md) | Shows the status of the pump. | + + ## Statistics and plan management | SQL Statement | Description | From c113006bf1361d9886d09423e839ca49ca0ca522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 10:37:47 +0200 Subject: [PATCH 05/31] Apply suggestions from code review Co-authored-by: Grace Cai --- develop/dev-guide-create-table.md | 2 +- develop/dev-guide-tidb-crud-sql.md | 4 ++-- sql-statements/sql-statement-overview.md | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/develop/dev-guide-create-table.md b/develop/dev-guide-create-table.md index 88e7cdbd3bb25..3187e6d1fe3e5 100644 --- a/develop/dev-guide-create-table.md +++ b/develop/dev-guide-create-table.md @@ -195,7 +195,7 @@ CREATE TABLE `bookshop`.`ratings` ( ); ``` -See [default values](/data-type-default-values.md) for more details on what default values are supported for what datatypes. +For more information on default values of different data types, see [default values](/data-type-default-values.md). ### Prevent duplicate values diff --git a/develop/dev-guide-tidb-crud-sql.md b/develop/dev-guide-tidb-crud-sql.md index 38f2242968696..6a196e5ead333 100644 --- a/develop/dev-guide-tidb-crud-sql.md +++ b/develop/dev-guide-tidb-crud-sql.md @@ -21,7 +21,7 @@ TiDB is compatible with MySQL, you can use MySQL statements directly in most cas To experiment with SQL and test out TiDB compatibility with MySQL queries, you can try [TiDB Playground](https://play.tidbcloud.com/?utm_source=docs&utm_medium=basic-sql-operations). You can also first deploy a TiDB cluster and then run SQL statements in it. -This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [TiDB SQL Statement Overview](/sql-statements/sql-statement-overview.md). +This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [SQL statement overview](/sql-statements/sql-statement-overview.md). ## Category @@ -35,7 +35,7 @@ SQL is divided into the following 4 types according to their functions: - **DCL (Data Control Language)**: It is used to define access privileges and security levels. -The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [TiDB SQL Statement Overview](/sql-statements/sql-statement-overview.md). +The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [SQL statement overview](/sql-statements/sql-statement-overview.md). ## Data Manipulation Language diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index e820ee9411ed0..9e2067fe54872 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -20,7 +20,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) | Creates a new database. | | [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md) | Creates a new index on a table. | | [`CREATE SEQUENCE`](/sql-statements/sql-statement-create-sequence.md) | Creates a new sequence object. | -| [`CREATE TABLE LIKE`](/sql-statements/sql-statement-create-table-like.md) | Creates a table that is like another table. | +| [`CREATE TABLE LIKE`](/sql-statements/sql-statement-create-table-like.md) | Copies the definition of an existing table, without copying any data. | | [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) | Creates a new table. | | [`CREATE VIEW`](/sql-statements/sql-statement-create-view.md) | Creates a new view. | | [`DROP DATABASE`](/sql-statements/sql-statement-drop-database.md) | Drops an existing database. | @@ -84,7 +84,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | | [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | | [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | -| [`ADMIN CLEANUP`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up residual files or resources. | +| [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up indexes from a table. | | [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | @@ -92,7 +92,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | | [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | -| [`SET NAMES`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | +| [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | @@ -104,14 +104,14 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | | [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | | [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | -| [`ADMIN CLEANUP`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up residual files or resources. | +| [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up indexes from a table. | | [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | | [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | -| [`SET NAMES`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | +| [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | From 1401d67069f17bde5f51d960372a7a8a8b27a11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:01:44 +0200 Subject: [PATCH 06/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 9e2067fe54872..25d440a61c64e 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -36,7 +36,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) | Shows all databases. | | [`SHOW FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md) | Shows columns of a table. | | [`SHOW INDEXES`](/sql-statements/sql-statement-show-indexes.md) | Shows indexes of a table. | -| [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) | Shows all schemas. | +| [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) | An alias to `SHOW DATABASES`, which shows a list of databases that the current user has privileges to. | | [`SHOW TABLE NEXT_ROW_ID`](/sql-statements/sql-statement-show-table-next-rowid.md) | Shows the next row ID for a table. | | [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) | Shows regions of a table. | | [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) | Shows the status of tables. | From 54384fefb3479c3d540457f42a5efb6eff78cf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:21:20 +0200 Subject: [PATCH 07/31] Apply suggestions from code review Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 109 ++++++++++++----------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 25d440a61c64e..96f7169fa60d8 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -1,6 +1,6 @@ # SQL Statement Overview -TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are extended with MySQL and TiDB specific statements where required. +TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensions for MySQL and TiDB-specific statements where necessary. ## Schema management / Data definition statements (DDL) @@ -33,13 +33,13 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW CREATE DATABASE`](/sql-statements/sql-statement-show-create-database.md) | Shows the CREATE statement for a database. | | [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) | Shows the CREATE statement for a sequence. | | [`SHOW CREATE TABLE`](/sql-statements/sql-statement-show-create-table.md) | Shows the CREATE statement for a table. | -| [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) | Shows all databases. | +| [`SHOW DATABASES`](/sql-statements/sql-statement-show-databases.md) | Shows a list of databases that the current user has privileges to. | | [`SHOW FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md) | Shows columns of a table. | | [`SHOW INDEXES`](/sql-statements/sql-statement-show-indexes.md) | Shows indexes of a table. | | [`SHOW SCHEMAS`](/sql-statements/sql-statement-show-schemas.md) | An alias to `SHOW DATABASES`, which shows a list of databases that the current user has privileges to. | | [`SHOW TABLE NEXT_ROW_ID`](/sql-statements/sql-statement-show-table-next-rowid.md) | Shows the next row ID for a table. | -| [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) | Shows regions of a table. | -| [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) | Shows the status of tables. | +| [`SHOW TABLE REGIONS`](/sql-statements/sql-statement-show-table-regions.md) | Shows the Region information of a table in TiDB. | +| [`SHOW TABLE STATUS`](/sql-statements/sql-statement-show-table-status.md) | Shows various statistics about tables in TiDB. | | [`SHOW TABLES`](/sql-statements/sql-statement-show-tables.md) | Shows tables in a database. | | [`TRUNCATE`](/sql-statements/sql-statement-truncate.md) | Truncates all data from a table. | @@ -47,11 +47,11 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| -| [`BATCH`](/sql-statements/sql-statement-batch.md) | Batches DML operations on a table. | +| [`BATCH`](/sql-statements/sql-statement-batch.md) | Splits a DML statement into multiple statements in TiDB for execution. | | [`DELETE`](/sql-statements/sql-statement-delete.md) | Deletes rows from a table. | | [`INSERT`](/sql-statements/sql-statement-insert.md) | Inserts new rows into a table. | | [`REPLACE`](/sql-statements/sql-statement-replace.md) | Replaces existing rows or inserts new rows. | -| [`SELECT`](/sql-statements/sql-statement-select.md) | Retrieves rows from a table. | +| [`SELECT`](/sql-statements/sql-statement-select.md) | Reads data from a table. | | [`TABLE`](/sql-statements/sql-statement-table.md) | Retrieves rows from a table. | | [`UPDATE`](/sql-statements/sql-statement-update.md) | Updates existing rows in a table. | | [`WITH`](/sql-statements/sql-statement-with.md) | Defines common table expressions. | @@ -64,16 +64,16 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`COMMIT`](/sql-statements/sql-statement-commit.md) | Commits the current transaction. | | [`ROLLBACK`](/sql-statements/sql-statement-rollback.md) | Rolls back the current transaction. | | [`SAVEPOINT`](/sql-statements/sql-statement-savepoint.md) | Sets a savepoint within a transaction. | -| [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) | Sets the characteristics of the current transaction. | +| [`SET TRANSACTION`](/sql-statements/sql-statement-set-transaction.md) | Changes the current isolation level on a `GLOBAL` or `SESSION` basis. | | [`START TRANSACTION`](/sql-statements/sql-statement-start-transaction.md) | Starts a new transaction. | ## Prepared statements | SQL Statement | Description | |---------------|-------------| -| [`DEALLOCATE`](/sql-statements/sql-statement-deallocate.md) | Deallocates a previously prepared statement. | -| [`EXECUTE`](/sql-statements/sql-statement-execute.md) | Executes a previously prepared statement. | -| [`PREPARE`](/sql-statements/sql-statement-prepare.md) | Prepares a statement for execution. | +| [`DEALLOCATE`](/sql-statements/sql-statement-deallocate.md) | Deallocates a prepared statement, freeing associated resources. | +| [`EXECUTE`](/sql-statements/sql-statement-execute.md) | Executes a prepared statement with specific parameter values. | +| [`PREPARE`](/sql-statements/sql-statement-prepare.md) | Creates a prepared statement with placeholders. | ## Administrative statements @@ -93,7 +93,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | -| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | +| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | @@ -109,10 +109,10 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | -| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for MySQL compatibility. It has no effective usage in TiDB. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | -| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a region into smaller regions. | +| [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | @@ -121,7 +121,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| | [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) | Cancels an ongoing import job. | -| [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) | Imports data into a table from an external source. | +| [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) | Imports data into a table via the [Physical Import Mode](https://docs.pingcap.com/tidb/stable/tidb-lightning-physical-import-mode) of TiDB Lightning. | | [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) | Loads data into a table from a file. | | [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) | Shows the status of an import job. | @@ -129,14 +129,15 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| -| [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers a damaged index. | -| [`BACKUP`](/sql-statements/sql-statement-backup.md) | Creates a backup of the database. | +| [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers the consistency based on the redundant indexes. | +| [`BACKUP`](/sql-statements/sql-statement-backup.md) | Perform a distributed backup of the TiDB cluster. | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a previous state. | -| [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores the database to a previous state. | +| [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data that are deleted by the `DROP` statement. | | [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restores a table to a previous state. | -| [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a table. | +| [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a deleted table and the data on it. | | [`RESTORE`](/sql-statements/sql-statement-restore.md) | Restores a database from a backup. | -| [`SHOW BACKUPS`](/sql-statements/sql-statement-show-backups.md) | Shows backups. | +| [`SHOW BACKUPS`](/sql-statements/sql-statement-show-backups.md) | Shows backup tasks. | +| [`SHOW RESTORES`](/sql-statements/sql-statement-show-backups.md) | Shows restore tasks. | ## Placement policy @@ -146,7 +147,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`ALTER RANGE`](/sql-statements/sql-statement-alter-range.md) | Modifies the range of a placement policy. | | [`CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-create-placement-policy.md) | Creates a new placement policy. | | [`DROP PLACEMENT POLICY`](/sql-statements/sql-statement-drop-placement-policy.md) | Drops an existing placement policy. | -| [`SHOW CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-show-create-placement-policy.md) | Shows the CREATE statement for a placement policy. | +| [`SHOW CREATE PLACEMENT POLICY`](/sql-statements/sql-statement-show-create-placement-policy.md) | Shows the `CREATE` statement for a placement policy. | | [`SHOW PLACEMENT FOR`](/sql-statements/sql-statement-show-placement-for.md) | Shows placement rules for a specific table. | | [`SHOW PLACEMENT LABELS`](/sql-statements/sql-statement-show-placement-labels.md) | Shows available placement labels. | | [`SHOW PLACEMENT`](/sql-statements/sql-statement-show-placement.md) | Shows placement rules. | @@ -158,12 +159,12 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | -| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Calibrates system resources. | +| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the ['Request Unit (RU)`](/tidb-resource-control#what-is-request-unit-ru) capacity of the current cluster. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | | [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | | [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | -| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the CREATE statement for a resource group. | +| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the `CREATE` statement for a resource group. | @@ -176,7 +177,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | | [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | | [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | -| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the CREATE statement for a resource group. | +| [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the `CREATE` statement for a resource group. | @@ -186,9 +187,9 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex |---------------|-------------| | [`DESC`](/sql-statements/sql-statement-desc.md) | Describes the structure of a table. | | [`DESCRIBE`](/sql-statements/sql-statement-describe.md) | Describes the structure of a table. | -| [`DO`](/sql-statements/sql-statement-do.md) | Executes an expression. | +| [`DO`](/sql-statements/sql-statement-do.md) | Executes an expression but does not return any results. | | [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Shows the execution plan of a query. | -| [`TRACE`](/sql-statements/sql-statement-trace.md) | Traces query execution. | +| [`TRACE`](/sql-statements/sql-statement-trace.md) | Provides detailed information about query execution. | | [`USE`](/sql-statements/sql-statement-use.md) | Sets the current database. | ## Show statements @@ -198,7 +199,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) | Lists builtin functions. | | [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) | Lists character sets. | | [`SHOW COLLATIONS`](/sql-statements/sql-statement-show-collation.md) | Lists collations. | -| [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows error messages. | +| [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows errors from previously executed statements. | | [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Shows server status. | | [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | | [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warning messages. | @@ -211,13 +212,13 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | | [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Resets status variables. | -| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a process. | -| [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration. | +| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | +| [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration of various components of TiDB. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | | [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows active threads. | | [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | -| [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Shuts down the database server. | +| [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Stops the client-connected TiDB instance, not the entire TiDB cluster. | @@ -226,13 +227,13 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | -| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Resets status variables. | -| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a process. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | -| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the status of the master server. | +| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | -| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows active threads. | -| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | +| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Currently only returns an empty result. | @@ -240,9 +241,9 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| -| [`LOCK STATS`](/sql-statements/sql-statement-lock-stats.md) | Locks statistics for a table. | +| [`LOCK STATS`](/sql-statements/sql-statement-lock-stats.md) | Locks statistics of tables or partitions. | | [`LOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | Locks tables for the current session. | -| [`UNLOCK STATS`](/sql-statements/sql-statement-unlock-stats.md) | Unlocks statistics for a table. | +| [`UNLOCK STATS`](/sql-statements/sql-statement-unlock-stats.md) | Unlocks statistics of tables or partitions. | | [`UNLOCK TABLES`](/sql-statements/sql-statement-lock-tables-and-unlock-tables.md) | Unlocks tables. | ## Account management / Data Control Language @@ -254,7 +255,7 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`CREATE USER`](/sql-statements/sql-statement-create-user.md) | Creates a new user. | | [`DROP ROLE`](/sql-statements/sql-statement-drop-role.md) | Drops an existing role. | | [`DROP USER`](/sql-statements/sql-statement-drop-user.md) | Drops an existing user. | -| [`FLUSH PRIVILEGES`](/sql-statements/sql-statement-flush-privileges.md) | Activates privilege changes. | +| [`FLUSH PRIVILEGES`](/sql-statements/sql-statement-flush-privileges.md) | Reloads the in-memory copy of privileges from the privilege tables. | | [`GRANT `](/sql-statements/sql-statement-grant-privileges.md) | Grants privileges. | | [`GRANT `](/sql-statements/sql-statement-grant-role.md) | Grants a role. | | [`RENAME USER`](/sql-statements/sql-statement-rename-user.md) | Renames an existing user. | @@ -262,9 +263,9 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | [`REVOKE `](/sql-statements/sql-statement-revoke-role.md) | Revokes a role. | | [`SET DEFAULT ROLE`](/sql-statements/sql-statement-set-default-role.md) | Sets a default role. | | [`SET PASSWORD`](/sql-statements/sql-statement-set-password.md) | Changes a password. | -| [`SET ROLE`](/sql-statements/sql-statement-set-role.md) | Sets a role. | -| [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) | Shows the CREATE statement for a user. | -| [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows grants for a user. | +| [`SET ROLE`](/sql-statements/sql-statement-set-role.md) | Enables roles in the current session. | +| [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) | Shows the `CREATE` statement for a user. | +| [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows privileges associated with a user. | | [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) | Shows available privileges. | @@ -274,11 +275,11 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| | [`ADMIN [SET\|SHOW\|UNSET] BDR ROLE`](/sql-statements/sql-statement-admin-bdr-role.md) | Manages BDR roles. | -| [`CHANGE DRAINER`](/sql-statements/sql-statement-change-drainer.md) | Changes drainer. | -| [`CHANGE PUMP`](/sql-statements/sql-statement-change-pump.md) | Changes pump. | -| [`SHOW DRAINER STATUS`](/sql-statements/sql-statement-show-drainer-status.md) | Shows the status of the drainer. | -| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the status of the master server. | -| [`SHOW PUMP STATUS`](/sql-statements/sql-statement-show-pump-status.md) | Shows the status of the pump. | +| [`CHANGE DRAINER`](/sql-statements/sql-statement-change-drainer.md) | Modifies the status information for Drainer in the cluster. | +| [`CHANGE PUMP`](/sql-statements/sql-statement-change-pump.md) | Modifies the status information for Pump in the cluster. | +| [`SHOW DRAINER STATUS`](/sql-statements/sql-statement-show-drainer-status.md) | Shows the status for all Drainer nodes in the cluster. | +| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | +| [`SHOW PUMP STATUS`](/sql-statements/sql-statement-show-pump-status.md) | Shows the status information for all Pump nodes in the cluster. | @@ -287,14 +288,14 @@ TiDB uses SQL statements that try to follow the ISO/IEC SQL standards and are ex | SQL Statement | Description | |---------------|-------------| | [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md) | Collects statistics about a table. | -| [`CREATE BINDING`](/sql-statements/sql-statement-create-binding.md) | Creates a plan binding. | -| [`DROP BINDING`](/sql-statements/sql-statement-drop-binding.md) | Drops a plan binding. | +| [`CREATE BINDING`](/sql-statements/sql-statement-create-binding.md) | Creates an execution plan binding for a SQL statement. | +| [`DROP BINDING`](/sql-statements/sql-statement-drop-binding.md) | Drops an execution plan binding from a SQL statement. | | [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) | Drops statistics from a table. | | [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Analyze query execution. | -| [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Load statistics. | -| [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Show analyze status. | -| [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Show bindings. | -| [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) | Shows the health of statistics. | -| [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) | Shows statistics histograms. | -| [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) | Shows locked statistics. | -| [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) | Shows metadata statistics. | \ No newline at end of file +| [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Load statistics into TiDB. | +| [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Show statistics collection tasks. | +| [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Show created SQL bindings. | +| [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) | Shows an estimation of how accurate statistics are believed to be. | +| [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) | Shows the histogram information in statistics. | +| [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) | Shows the tables whose statistics are locked. | +| [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) | Shows how many rows are in a table and how many rows are changed in that table. | \ No newline at end of file From da0a832ead4bc3063fa2f7dd9c99ed39979c3616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:25:18 +0200 Subject: [PATCH 08/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 96f7169fa60d8..1ed4886021b34 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -133,7 +133,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`BACKUP`](/sql-statements/sql-statement-backup.md) | Perform a distributed backup of the TiDB cluster. | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a previous state. | | [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data that are deleted by the `DROP` statement. | -| [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restores a table to a previous state. | +| [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restore the tables and data dropped by the `DROP` or `TRUNCATE` operation. | | [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a deleted table and the data on it. | | [`RESTORE`](/sql-statements/sql-statement-restore.md) | Restores a database from a backup. | | [`SHOW BACKUPS`](/sql-statements/sql-statement-show-backups.md) | Shows backup tasks. | From c29724f195a95ab0dfc50f5f6cbb7f82c93a516e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:36:10 +0200 Subject: [PATCH 09/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 1ed4886021b34..b8cddfa2a0750 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -216,7 +216,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration of various components of TiDB. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | -| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows active threads. | +| [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | | [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | | [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Stops the client-connected TiDB instance, not the entire TiDB cluster. | From a1e2e8435acf3e90873546bdd8cbf0cc7b9c7db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:38:29 +0200 Subject: [PATCH 10/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index b8cddfa2a0750..c24e6fe2177ab 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -291,7 +291,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`CREATE BINDING`](/sql-statements/sql-statement-create-binding.md) | Creates an execution plan binding for a SQL statement. | | [`DROP BINDING`](/sql-statements/sql-statement-drop-binding.md) | Drops an execution plan binding from a SQL statement. | | [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) | Drops statistics from a table. | -| [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Analyze query execution. | +| [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Works similar to `EXPLAIN`, with the major difference that it will execute the statement. | | [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Load statistics into TiDB. | | [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Show statistics collection tasks. | | [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Show created SQL bindings. | From 287b4cbbc4418eb19fdc2c848df7cdabde84c886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:38:59 +0200 Subject: [PATCH 11/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index c24e6fe2177ab..7d1e1343237c6 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -90,8 +90,8 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN SHOW TELEMETRY`](/sql-statements/sql-statement-admin-show-telemetry.md) | Shows telemetry data. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | -| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Flushes a table. | -| [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for MySQL compatibility. It has no effective usage in TiDB. | +| [`SET `](/sql-statements/sql-statement-set-variable.md) | Modifies a system variable or user variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | From bd69faa56ac835a232d9f05561fac37550fdc05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:39:13 +0200 Subject: [PATCH 12/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 7d1e1343237c6..bad6fee939c0d 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -110,7 +110,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | | [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for MySQL compatibility. It has no effective usage in TiDB. | -| [`SET `](/sql-statements/sql-statement-set-variable.md) | Sets a variable. | +| [`SET `](/sql-statements/sql-statement-set-variable.md) | Modifies a system variable or user variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | From 3257654244a78251b735cbf0ea3994c26377dc31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:39:29 +0200 Subject: [PATCH 13/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index bad6fee939c0d..8cdef232c4056 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -122,7 +122,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio |---------------|-------------| | [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) | Cancels an ongoing import job. | | [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) | Imports data into a table via the [Physical Import Mode](https://docs.pingcap.com/tidb/stable/tidb-lightning-physical-import-mode) of TiDB Lightning. | -| [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) | Loads data into a table from a file. | +| [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) | Loads data into a table from Amazon S3 or Google Cloud Storage. | | [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) | Shows the status of an import job. | ## Backup & restore From 69775593ebd1f43b9faf482581769b7464cf8595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:45:08 +0200 Subject: [PATCH 14/31] Update sql-statements/sql-statement-overview.md --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 8cdef232c4056..974db1cd82228 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -131,7 +131,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio |---------------|-------------| | [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers the consistency based on the redundant indexes. | | [`BACKUP`](/sql-statements/sql-statement-backup.md) | Perform a distributed backup of the TiDB cluster. | -| [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a previous state. | +| [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a specific snapshot. | | [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data that are deleted by the `DROP` statement. | | [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restore the tables and data dropped by the `DROP` or `TRUNCATE` operation. | | [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a deleted table and the data on it. | From 8047f9cb003002715b25cae3d51bdf5e14b5178a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:51:43 +0200 Subject: [PATCH 15/31] fixup --- sql-statements/sql-statement-overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 974db1cd82228..e1362ce9b63ea 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -159,7 +159,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | -| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the ['Request Unit (RU)`](/tidb-resource-control#what-is-request-unit-ru) capacity of the current cluster. | +| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [`Request Unit (RU)`](/tidb-resource-control#what-is-request-unit-ru) capacity of the current cluster. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | | [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | @@ -298,4 +298,4 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) | Shows an estimation of how accurate statistics are believed to be. | | [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) | Shows the histogram information in statistics. | | [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) | Shows the tables whose statistics are locked. | -| [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) | Shows how many rows are in a table and how many rows are changed in that table. | \ No newline at end of file +| [`SHOW STATS_META`](/sql-statements/sql-statement-show-stats-meta.md) | Shows how many rows are in a table and how many rows are changed in that table. | From 2f2975fb961d67c4c99e956db7c54b079842627b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:53:26 +0200 Subject: [PATCH 16/31] Apply suggestions from code review Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index e1362ce9b63ea..72ca1a30c7060 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -200,7 +200,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) | Lists character sets. | | [`SHOW COLLATIONS`](/sql-statements/sql-statement-show-collation.md) | Lists collations. | | [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows errors from previously executed statements. | -| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Shows server status. | +| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | | [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warning messages. | @@ -211,7 +211,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | -| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Resets status variables. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration of various components of TiDB. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | From 46e4d15fb2b1c81a4c2bfb2cfd615c5ebf076a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 12:58:02 +0200 Subject: [PATCH 17/31] Add links for MySQL compat and monitoring --- sql-statements/sql-statement-overview.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 72ca1a30c7060..66665d756b96e 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -90,7 +90,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN SHOW TELEMETRY`](/sql-statements/sql-statement-admin-show-telemetry.md) | Shows telemetry data. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | -| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for MySQL compatibility. It has no effective usage in TiDB. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for [MySQL compatibility](/mysql-compatibility.md). It has no effective usage in TiDB. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Modifies a system variable or user variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | @@ -109,7 +109,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | -| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for MySQL compatibility. It has no effective usage in TiDB. | +| [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md) | Included for [MySQL compatibility](/mysql-compatibility.md). It has no effective usage in TiDB. | | [`SET `](/sql-statements/sql-statement-set-variable.md) | Modifies a system variable or user variable. | | [`SET [NAMES\|CHARACTER SET]`](/sql-statements/sql-statement-set-names.md) | Set a character set and collation. | | [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) | Splits a Region into smaller Regions. | @@ -200,7 +200,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) | Lists character sets. | | [`SHOW COLLATIONS`](/sql-statements/sql-statement-show-collation.md) | Lists collations. | | [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows errors from previously executed statements. | -| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB uses [Prometheus and Grafana](/tidb-monitoring-framework.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | | [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warning messages. | @@ -211,13 +211,13 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | -| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB uses [Prometheus and Grafana](/tidb-monitoring-framework.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) | Shows the configuration of various components of TiDB. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | | [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | -| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. Included for [compatibility with MySQL](/mysql-compatibility.md). Currently only returns an empty result. | | [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Stops the client-connected TiDB instance, not the entire TiDB cluster. | @@ -227,7 +227,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | -| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for compatibility with MySQL. TiDB uses Prometheus and Grafana for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB uses [Prometheus and Grafana](/tidb-monitoring-framework.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | From ecc290980ab202d4515a010c4adbd12454fa46bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:21:10 +0200 Subject: [PATCH 18/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 66665d756b96e..00a8f4d815686 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -202,7 +202,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows errors from previously executed statements. | | [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB uses [Prometheus and Grafana](/tidb-monitoring-framework.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | -| [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warning messages. | +| [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warnings and notes from previously executed statements. | ## Instance management From f5de44a838497fa6e39f64f0fefdf3370f05b1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:21:30 +0200 Subject: [PATCH 19/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 00a8f4d815686..54873bb9ddb95 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -186,7 +186,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`DESC`](/sql-statements/sql-statement-desc.md) | Describes the structure of a table. | -| [`DESCRIBE`](/sql-statements/sql-statement-describe.md) | Describes the structure of a table. | +| [`DESCRIBE`](/sql-statements/sql-statement-describe.md) | Shows the structure of a table. | | [`DO`](/sql-statements/sql-statement-do.md) | Executes an expression but does not return any results. | | [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Shows the execution plan of a query. | | [`TRACE`](/sql-statements/sql-statement-trace.md) | Provides detailed information about query execution. | From 8e3d3a238563b4b8c45d0e92c0f4b3304aaaf8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:21:54 +0200 Subject: [PATCH 20/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 54873bb9ddb95..0ee2088ba8a66 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -185,7 +185,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| -| [`DESC`](/sql-statements/sql-statement-desc.md) | Describes the structure of a table. | +| [`DESC`](/sql-statements/sql-statement-desc.md) | An alias to `DESCRIBE`, which shows the structure of a table. | | [`DESCRIBE`](/sql-statements/sql-statement-describe.md) | Shows the structure of a table. | | [`DO`](/sql-statements/sql-statement-do.md) | Executes an expression but does not return any results. | | [`EXPLAIN`](/sql-statements/sql-statement-explain.md) | Shows the execution plan of a query. | From 6dede6e5b398189eb3c9c52bf843310c1a4ef890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:22:18 +0200 Subject: [PATCH 21/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 0ee2088ba8a66..e4ccf16de3eba 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -159,7 +159,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | -| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [`Request Unit (RU)`](/tidb-resource-control#what-is-request-unit-ru) capacity of the current cluster. | +| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [`Request Unit (RU)`](/tidb-resource-control.md#what-is-request-unit-ru) capacity of the current cluster. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | | [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | From 19146e6f0b7c3c12d15cb6317e07907f9d71877e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:24:05 +0200 Subject: [PATCH 22/31] update show profiles --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index e4ccf16de3eba..48f14886d1ff0 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -233,7 +233,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | | [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | -| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Currently only returns an empty result. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. Included for [compatibility with MySQL](/mysql-compatibility.md). Currently only returns an empty result. | From 2ba885adc218b1a2bb2cf7c36f2492802ba2160c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 23 May 2024 13:31:56 +0200 Subject: [PATCH 23/31] Update monitoring links for cloud --- sql-statements/sql-statement-overview.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 48f14886d1ff0..e02a284a130de 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -194,6 +194,8 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio ## Show statements + + | SQL Statement | Description | |---------------|-------------| | [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) | Lists builtin functions. | @@ -204,6 +206,22 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | | [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warnings and notes from previously executed statements. | + + + + +| SQL Statement | Description | +|---------------|-------------| +| [`SHOW BUILTINS`](/sql-statements/sql-statement-show-builtins.md) | Lists builtin functions. | +| [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) | Lists character sets. | +| [`SHOW COLLATIONS`](/sql-statements/sql-statement-show-collation.md) | Lists collations. | +| [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md) | Shows errors from previously executed statements. | +| [`SHOW STATUS`](/sql-statements/sql-statement-show-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB Cloud provides [Monitoring](/tidb-cloud/monitor-tidb-cluster.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`SHOW VARIABLES`](/sql-statements/sql-statement-show-variables.md) | Shows system variables. | +| [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) | Shows warnings and notes from previously executed statements. | + + + ## Instance management @@ -227,7 +245,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER INSTANCE`](/sql-statements/sql-statement-alter-instance.md) | Modifies an instance. | -| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB uses [Prometheus and Grafana](/tidb-monitoring-framework.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | +| [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB Cloud provides [Monitoring](/tidb-cloud/monitor-tidb-cluster.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | From df37799011b01d0a424f6fb6689838ba8e1b21cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 24 May 2024 06:46:06 +0200 Subject: [PATCH 24/31] Update sql-statements/sql-statement-overview.md Co-authored-by: kennytm --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index e02a284a130de..241d0dc441fa9 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -83,7 +83,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio |---------------|-------------| | [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | | [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | -| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | +| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes the checksum of a table. | | [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up indexes from a table. | | [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | From 81b3f5fc244b3860f603574c0c792d8a397e7dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 24 May 2024 08:29:13 +0200 Subject: [PATCH 25/31] Apply suggestions from code review Co-authored-by: kennytm Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 241d0dc441fa9..e37ac9c557852 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -103,7 +103,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio |---------------|-------------| | [`ADMIN CANCEL DDL`](/sql-statements/sql-statement-admin-cancel-ddl.md) | Cancels a DDL job. | | [`ADMIN CHECK [TABLE\|INDEX]`](/sql-statements/sql-statement-admin-check-table-index.md) | Checks the integrity of a table or index. | -| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes and checks the checksum of a table. | +| [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes the checksum of a table. | | [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up indexes from a table. | | [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | @@ -159,7 +159,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | -| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [`Request Unit (RU)`](/tidb-resource-control.md#what-is-request-unit-ru) capacity of the current cluster. | +| [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [Request Unit (RU)](/tidb-resource-control.md#what-is-request-unit-ru) capacity of the current cluster. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | | [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | @@ -235,7 +235,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | | [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | -| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. Included for [compatibility with MySQL](/mysql-compatibility.md). Currently only returns an empty result. | +| [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. Included for [compatibility with MySQL](/mysql-compatibility.md). Currently, it only returns an empty result. | | [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) | Stops the client-connected TiDB instance, not the entire TiDB cluster. | From e2abe3ea933bc4a8db0c9a7c46c07f685c7c2180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 24 May 2024 08:31:36 +0200 Subject: [PATCH 26/31] Move ADMIN RECOVER INDEX based on review --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index e37ac9c557852..00be6f1aeda70 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -106,6 +106,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ADMIN CHECKSUM TABLE`](/sql-statements/sql-statement-admin-checksum-table.md) | Computes the checksum of a table. | | [`ADMIN CLEANUP INDEX`](/sql-statements/sql-statement-admin-cleanup.md) | Cleans up indexes from a table. | | [`ADMIN PAUSE DDL`](/sql-statements/sql-statement-admin-pause-ddl.md) | Pauses DDL operations. | +| [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers the consistency based on the redundant indexes. | | [`ADMIN RESUME DDL`](/sql-statements/sql-statement-admin-resume-ddl.md) | Resumes DDL operations. | | [`ADMIN SHOW DDL [JOBS\|JOB QUERIES]`](/sql-statements/sql-statement-admin-show-ddl.md) | Shows DDL jobs or job queries. | | [`ADMIN`](/sql-statements/sql-statement-admin.md) | Performs various administrative tasks. | @@ -129,7 +130,6 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| -| [`ADMIN RECOVER INDEX`](/sql-statements/sql-statement-admin-recover.md) | Recovers the consistency based on the redundant indexes. | | [`BACKUP`](/sql-statements/sql-statement-backup.md) | Perform a distributed backup of the TiDB cluster. | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a specific snapshot. | | [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data that are deleted by the `DROP` statement. | From 1597d9d37b8ae9af0bdc553c697942cb9a069f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 24 May 2024 08:47:02 +0200 Subject: [PATCH 27/31] Keep all the same sections for tidb-cloud --- sql-statements/sql-statement-overview.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 00be6f1aeda70..265bf90f463f8 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -248,7 +248,6 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`FLUSH STATUS`](/sql-statements/sql-statement-flush-status.md) | Included for [compatibility with MySQL](/mysql-compatibility.md). TiDB Cloud provides [Monitoring](/tidb-cloud/monitor-tidb-cluster.md) for centralized metrics collection instead of `SHOW STATUS` for most metrics. | | [`KILL`](/sql-statements/sql-statement-kill.md) | Kills a connection in any TiDB instance in the current TiDB cluster. | | [`SHOW ENGINES`](/sql-statements/sql-statement-show-engines.md) | Shows available storage engines. | -| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | | [`SHOW PLUGINS`](/sql-statements/sql-statement-show-plugins.md) | Shows installed plugins. | | [`SHOW PROCESSLIST`](/sql-statements/sql-statement-show-processlist.md) | Shows the current sessions connected to the same TiDB server. | | [`SHOW PROFILES`](/sql-statements/sql-statement-show-profiles.md) | Shows query profiles. Included for [compatibility with MySQL](/mysql-compatibility.md). Currently only returns an empty result. | @@ -286,10 +285,10 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows privileges associated with a user. | | [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) | Shows available privileges. | - - ## TiDB Binlog & TiCDC + + | SQL Statement | Description | |---------------|-------------| | [`ADMIN [SET\|SHOW\|UNSET] BDR ROLE`](/sql-statements/sql-statement-admin-bdr-role.md) | Manages BDR roles. | @@ -301,6 +300,14 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio + + +| SQL Statement | Description | +|---------------|-------------| +| [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | + + + ## Statistics and plan management | SQL Statement | Description | From 0e45b88e06034877e52983f1968016965242ea96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Fri, 24 May 2024 16:33:41 +0200 Subject: [PATCH 28/31] Update sql-statements/sql-statement-overview.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 265bf90f463f8..95fb2c53ce670 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -285,7 +285,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md) | Shows privileges associated with a user. | | [`SHOW PRIVILEGES`](/sql-statements/sql-statement-show-privileges.md) | Shows available privileges. | -## TiDB Binlog & TiCDC +## TiCDC & TiDB Binlog From 87bd887bb434a335d23d9e224e75ffba1cef281f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 27 May 2024 06:28:15 +0200 Subject: [PATCH 29/31] Update develop/dev-guide-tidb-crud-sql.md Co-authored-by: xixirangrang --- develop/dev-guide-tidb-crud-sql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop/dev-guide-tidb-crud-sql.md b/develop/dev-guide-tidb-crud-sql.md index 6a196e5ead333..0b22a77fc6ef3 100644 --- a/develop/dev-guide-tidb-crud-sql.md +++ b/develop/dev-guide-tidb-crud-sql.md @@ -21,7 +21,7 @@ TiDB is compatible with MySQL, you can use MySQL statements directly in most cas To experiment with SQL and test out TiDB compatibility with MySQL queries, you can try [TiDB Playground](https://play.tidbcloud.com/?utm_source=docs&utm_medium=basic-sql-operations). You can also first deploy a TiDB cluster and then run SQL statements in it. -This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [SQL statement overview](/sql-statements/sql-statement-overview.md). +This page walks you through the basic TiDB SQL statements such as DDL, DML, and CRUD operations. For a complete list of TiDB statements, see [SQL Statement Overview](/sql-statements/sql-statement-overview.md). ## Category From eb5cf34fdd9d9e34c4408326e8829497c821a4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Mon, 27 May 2024 07:36:13 +0200 Subject: [PATCH 30/31] Apply suggestions from code review Co-authored-by: xixirangrang Co-authored-by: Grace Cai --- develop/dev-guide-tidb-crud-sql.md | 2 +- sql-statements/sql-statement-overview.md | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/develop/dev-guide-tidb-crud-sql.md b/develop/dev-guide-tidb-crud-sql.md index 0b22a77fc6ef3..edbb34937b0c3 100644 --- a/develop/dev-guide-tidb-crud-sql.md +++ b/develop/dev-guide-tidb-crud-sql.md @@ -35,7 +35,7 @@ SQL is divided into the following 4 types according to their functions: - **DCL (Data Control Language)**: It is used to define access privileges and security levels. -The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [SQL statement overview](/sql-statements/sql-statement-overview.md). +The following mainly introduces DML and DQL. For more information about DDL and DCL, see [Explore SQL with TiDB](/basic-sql-operations.md) or [SQL Statement Overview](/sql-statements/sql-statement-overview.md). ## Data Manipulation Language diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index 95fb2c53ce670..cb673e31c31a0 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -1,3 +1,7 @@ +--- +title: SQL Statement Overview +summary: Learn about SQL statement overview. +--- # SQL Statement Overview TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensions for MySQL and TiDB-specific statements where necessary. @@ -130,9 +134,9 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | SQL Statement | Description | |---------------|-------------| -| [`BACKUP`](/sql-statements/sql-statement-backup.md) | Perform a distributed backup of the TiDB cluster. | +| [`BACKUP`](/sql-statements/sql-statement-backup.md) | Performs a distributed backup of the TiDB cluster. | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Restores the cluster to a specific snapshot. | -| [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data that are deleted by the `DROP` statement. | +| [`FLASHBACK DATABASE`](/sql-statements/sql-statement-flashback-database.md) | Restores a database and its data deleted by the `DROP` statement. | | [`FLASHBACK TABLE`](/sql-statements/sql-statement-flashback-table.md) | Restore the tables and data dropped by the `DROP` or `TRUNCATE` operation. | | [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) | Recovers a deleted table and the data on it. | | [`RESTORE`](/sql-statements/sql-statement-restore.md) | Restores a database from a backup. | @@ -162,7 +166,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md) | Estimates and outputs the [Request Unit (RU)](/tidb-resource-control.md#what-is-request-unit-ru) capacity of the current cluster. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | -| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | +| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manages the runaway query watch list. | | [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | | [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the `CREATE` statement for a resource group. | @@ -175,7 +179,7 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`ALTER RESOURCE GROUP`](/sql-statements/sql-statement-alter-resource-group.md) | Modifies a resource group. | | [`CREATE RESOURCE GROUP`](/sql-statements/sql-statement-create-resource-group.md) | Creates a new resource group. | | [`DROP RESOURCE GROUP`](/sql-statements/sql-statement-drop-resource-group.md) | Drops a resource group. | -| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manage runaway query watch list. | +| [`QUERY WATCH`](/sql-statements/sql-statement-query-watch.md) | Manages the runaway query watch list. | | [`SET RESOURCE GROUP`](/sql-statements/sql-statement-set-resource-group.md) | Sets a resource group. | | [`SHOW CREATE RESOURCE GROUP`](/sql-statements/sql-statement-show-create-resource-group.md) | Shows the `CREATE` statement for a resource group. | @@ -301,7 +305,9 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio - +> **Note:** +> +> [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) & [TiDB Binlog](https://docs.pingcap.com/tidb/stable/tidb-binlog-overview) are tools for replicating TiDB data to the upstream for TiDB Self-Hosted. Most SQL statements for TiCDC and TiDB Binlog are not applicable to TiDB Cloud. For TiDB Cloud, you can use the [Changefeed](/tidb-cloud/changefeed-overview.md) feature in the [TiDB Cloud console](https://tidbcloud.com) instead to stream data. | SQL Statement | Description | |---------------|-------------| | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. | @@ -317,9 +323,9 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio | [`DROP BINDING`](/sql-statements/sql-statement-drop-binding.md) | Drops an execution plan binding from a SQL statement. | | [`DROP STATS`](/sql-statements/sql-statement-drop-stats.md) | Drops statistics from a table. | | [`EXPLAIN ANALYZE`](/sql-statements/sql-statement-explain-analyze.md) | Works similar to `EXPLAIN`, with the major difference that it will execute the statement. | -| [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Load statistics into TiDB. | -| [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Show statistics collection tasks. | -| [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Show created SQL bindings. | +| [`LOAD STATS`](/sql-statements/sql-statement-load-stats.md) | Loads statistics into TiDB. | +| [`SHOW ANALYZE STATUS`](/sql-statements/sql-statement-show-analyze-status.md) | Shows statistics collection tasks. | +| [`SHOW BINDINGS`](/sql-statements/sql-statement-show-bindings.md) | Shows created SQL bindings. | | [`SHOW STATS_HEALTHY`](/sql-statements/sql-statement-show-stats-healthy.md) | Shows an estimation of how accurate statistics are believed to be. | | [`SHOW STATS_HISTOGRAMS`](/sql-statements/sql-statement-show-stats-histograms.md) | Shows the histogram information in statistics. | | [`SHOW STATS_LOCKED`](/sql-statements/sql-statement-show-stats-locked.md) | Shows the tables whose statistics are locked. | From d6a11b5abb2ec7623789d13e134dfcfe805105c2 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 27 May 2024 14:28:55 +0800 Subject: [PATCH 31/31] format udpates --- sql-statements/sql-statement-overview.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-overview.md b/sql-statements/sql-statement-overview.md index cb673e31c31a0..40b5b6112bfc5 100644 --- a/sql-statements/sql-statement-overview.md +++ b/sql-statements/sql-statement-overview.md @@ -1,7 +1,8 @@ --- title: SQL Statement Overview -summary: Learn about SQL statement overview. +summary: Learn about supported SQL statements in TiDB. --- + # SQL Statement Overview TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensions for MySQL and TiDB-specific statements where necessary. @@ -305,9 +306,11 @@ TiDB uses SQL statements that aim to follow ISO/IEC SQL standards, with extensio + > **Note:** > > [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) & [TiDB Binlog](https://docs.pingcap.com/tidb/stable/tidb-binlog-overview) are tools for replicating TiDB data to the upstream for TiDB Self-Hosted. Most SQL statements for TiCDC and TiDB Binlog are not applicable to TiDB Cloud. For TiDB Cloud, you can use the [Changefeed](/tidb-cloud/changefeed-overview.md) feature in the [TiDB Cloud console](https://tidbcloud.com) instead to stream data. + | SQL Statement | Description | |---------------|-------------| | [`SHOW MASTER STATUS`](/sql-statements/sql-statement-show-master-status.md) | Shows the latest TSO in the cluster. |