-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds admin reference and updated some links (#1168)
Co-authored-by: Yiran <[email protected]>
- Loading branch information
1 parent
0efd9fa
commit 89168c4
Showing
17 changed files
with
103 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ADMIN | ||
|
||
`ADMIN` is used to run administration functions. | ||
|
||
```sql | ||
ADMIN function(arg1, arg2, ...) | ||
``` | ||
|
||
|
||
## Admin Functions | ||
|
||
GreptimeDB provides some administration functions to manage the database and data: | ||
|
||
* `flush_table(table_name)` to flush a table's memtables into SST file by table name. | ||
* `flush_region(region_id)` to flush a region's memtables into SST file by region id. Find the region id through [PARTITIONS](./information-schema/partitions.md) table. | ||
* `compact_table(table_name, [type], [options])` to schedule a compaction task for a table by table name, read [compaction](/user-guide/operations/compaction.md#strict-window-compaction-strategy-swcs-and-manual-compaction) for more details. | ||
* `compact_region(region_id)` to schedule a compaction task for a region by region id. | ||
* `migrate_region(region_id, from_peer, to_peer, [timeout])` to migrate regions between datanodes, please read the [Region Migration](/user-guide/operations/region-migration.md). | ||
* `procedure_state(procedure_id)` to query a procedure state by its id. | ||
* `flush_flow(flow_name)` to flush a flow's output into the sink table. | ||
|
||
For example: | ||
```sql | ||
-- Flush the table test -- | ||
admin flush_table("test"); | ||
|
||
-- Schedule a compaction for table test -- | ||
admin compact_table("test"); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
i18n/zh/docusaurus-plugin-content-docs/current/reference/sql/admin.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ADMIN | ||
|
||
`ADMIN` 语句用于运行管理函数: | ||
|
||
```sql | ||
ADMIN function(arg1, arg2, ...) | ||
``` | ||
|
||
## 管理函数 | ||
|
||
GreptimeDB 提供了一些管理函数来管理数据库和数据: | ||
|
||
* `flush_table(table_name)` 根据表名将表的 Memtable 刷新到 SST 文件中。 | ||
* `flush_region(region_id)` 根据 Region ID 将 Region 的 Memtable 刷新到 SST 文件中。通过 [PARTITIONS](./information-schema/partitions.md) 表查找 Region ID。 | ||
* `compact_table(table_name, [type], [options])` 为表启动一个 compaction 任务,详细信息请阅读 [compaction](/user-guide/operations/compaction.md#严格窗口压缩策略swcs和手动压缩)。 | ||
* `compact_region(region_id)` 为 Region 启动一个 compaction 任务。 | ||
* `migrate_region(region_id, from_peer, to_peer, [timeout])` 在 Datanode 之间迁移 Region,请阅读 [Region Migration](/user-guide/operations/region-migration.md)。 | ||
* `procedure_state(procedure_id)` 根据 ID 查询 Procedure 状态。 | ||
* `flush_flow(flow_name)` 将 Flow 的输出刷新到目标接收表。 | ||
|
||
例如: | ||
```sql | ||
-- 刷新表 test -- | ||
admin flush_table("test"); | ||
|
||
-- 为表 test 启动 compaction 任务 -- | ||
admin compact_table("test"); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters