diff --git a/sql-statements/sql-statement-drop-index.md b/sql-statements/sql-statement-drop-index.md index fb1114671fa0f..0ea13e5633116 100644 --- a/sql-statements/sql-statement-drop-index.md +++ b/sql-statements/sql-statement-drop-index.md @@ -11,21 +11,29 @@ This statement removes an index from a specified table, marking space as free in ## Synopsis -**AlterTableStmt:** +**AlterTableDropIndexStmt:** -![AlterTableStmt](/media/sqlgram/AlterTableStmt.png) +![AlterTableDropIndexStmt](/media/sqlgram/AlterTableDropIndexStmt.png) -**AlterTableSpec:** +**IgnoreOptional:** -![AlterTableSpec](/media/sqlgram/AlterTableSpec.png) +![IgnoreOptional](/media/sqlgram/IgnoreOptional.png) + +**TableName:** + +![TableName](/media/sqlgram/TableName.png) + +**AlterTableDropIndexSpec:** + +![AlterTableDropIndexSpec](/media/sqlgram/AlterTableDropIndexSpec.png) **KeyOrIndex:** ![KeyOrIndex](/media/sqlgram/KeyOrIndex.png) -**Identifier:** +**IfExists:** -![Identifier](/media/sqlgram/Identifier.png) +![IfExists](/media/sqlgram/IfExists.png) ## Examples diff --git a/sql-statements/sql-statement-flashback-table.md b/sql-statements/sql-statement-flashback-table.md index 214770102410a..ade428c4e0389 100644 --- a/sql-statements/sql-statement-flashback-table.md +++ b/sql-statements/sql-statement-flashback-table.md @@ -25,6 +25,20 @@ select * from mysql.tidb where variable_name in ('tikv_gc_safe_point','tikv_gc_l FLASHBACK TABLE table_name [TO other_table_name] ``` +## Synopsis + +**FlashbackTableStmt:** + +![FlashbackTableStmt](/media/sqlgram/FlashbackTableStmt.png) + +**TableName:** + +![TableName](/media/sqlgram/TableName.png) + +**FlashbackToNewName:** + +![FlashbackToNewName](/media/sqlgram/FlashbackToNewName.png) + ## Notes If a table is dropped and the GC lifetime has passed, you can no longer use the `FLASHBACK TABLE` statement to recover the dropped data. Otherwise, an error like `Can't find dropped / truncated table 't' in GC safe point 2020-03-16 16:34:52 +0800 CST` will be returned. diff --git a/sql-statements/sql-statement-recover-table.md b/sql-statements/sql-statement-recover-table.md index b1ddcf215ec5c..6d4a8e9c73181 100644 --- a/sql-statements/sql-statement-recover-table.md +++ b/sql-statements/sql-statement-recover-table.md @@ -23,6 +23,24 @@ RECOVER TABLE table_name RECOVER TABLE BY JOB ddl_job_id ``` +## Synopsis + +**RecoverTableStmt:** + +![RecoverTableStmt](/media/sqlgram/RecoverTableStmt.png) + +**TableName:** + +![TableName](/media/sqlgram/TableName.png) + +**Int64Num:** + +![Int64Num](/media/sqlgram/Int64Num.png) + +**NUM:** + +![NUM](/media/sqlgram/NUM.png) + > **Note:** > > + If a table is deleted and the GC lifetime is out, the table cannot be recovered with `RECOVER TABLE`. Execution of `RECOVER TABLE` in this scenario returns an error like: `snapshot is older than GC safe point 2019-07-10 13:45:57 +0800 CST`. diff --git a/sql-statements/sql-statement-show-table-regions.md b/sql-statements/sql-statement-show-table-regions.md index cd4af23a75eec..d7b0aba6b6c03 100644 --- a/sql-statements/sql-statement-show-table-regions.md +++ b/sql-statements/sql-statement-show-table-regions.md @@ -9,13 +9,35 @@ aliases: ['/docs/dev/reference/sql/statements/show-table-regions/'] The `SHOW TABLE REGIONS` statement is used to show the Region information of a table in TiDB. -## Synopsis +## Syntax ```sql SHOW TABLE [table_name] REGIONS [WhereClauseOptional]; SHOW TABLE [table_name] INDEX [index_name] REGIONS [WhereClauseOptional]; ``` +## Synopsis + +**ShowTableRegionStmt:** + +![ShowTableRegionStmt](/media/sqlgram/ShowTableRegionStmt.png) + +**TableName:** + +![TableName](/media/sqlgram/TableName.png) + +**PartitionNameListOpt:** + +![PartitionNameListOpt](/media/sqlgram/PartitionNameListOpt.png) + +**WhereClauseOptional:** + +![WhereClauseOptional](/media/sqlgram/WhereClauseOptional.png) + +**WhereClause:** + +![WhereClause](/media/sqlgram/WhereClause.png) + Executing `SHOW TABLE REGIONS` returns the following columns: * `REGION_ID`: The Region ID. diff --git a/sql-statements/sql-statement-split-region.md b/sql-statements/sql-statement-split-region.md index c2b4c1e36479c..25a2c6f035042 100644 --- a/sql-statements/sql-statement-split-region.md +++ b/sql-statements/sql-statement-split-region.md @@ -13,6 +13,36 @@ In the above case, because there is only one Region at the beginning, all write To solve the hotspot problem in the above scenario, TiDB introduces the pre-split function, which can pre-split multiple Regions for a certain table according to the specified parameters and scatter them to each TiKV node. +## Synopsis + +**SplitRegionStmt:** + +![SplitRegionStmt](/media/sqlgram/SplitRegionStmt.png) + +**SplitSyntaxOption:** + +![SplitSyntaxOption](/media/sqlgram/SplitSyntaxOption.png) + +**TableName:** + +![TableName](/media/sqlgram/TableName.png) + +**PartitionNameListOpt:** + +![PartitionNameListOpt](/media/sqlgram/PartitionNameListOpt.png) + +**SplitOption:** + +![SplitOption](/media/sqlgram/SplitOption.png) + +**RowValue:** + +![RowValue](/media/sqlgram/RowValue.png) + +**Int64Num:** + +![Int64Num](/media/sqlgram/Int64Num.png) + ## Usage of Split Region There are two types of Split Region syntax: