Skip to content

Commit

Permalink
feat: add compact and flush statements (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopeng8570 authored Dec 3, 2024
1 parent 1e3fe85 commit 18194b9
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@
- title_en: TRIM
title_cn: TRIM
path: sql-reference/statements/trim
- title_en: FLUSH
title_cn: FLUSH
path: sql-reference/statements/flush
- title_en: COMPACT
title_cn: COMPACT
path: sql-reference/statements/compact
- title_en: Functions
title_cn: 函数
collapsed: true
Expand Down
26 changes: 26 additions & 0 deletions en_US/sql-reference/statements/compact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## COMPACT TABLE
压缩指定的 table,可以指定压缩的目标时间窗口。
**语法**
```SQL
# 压缩非活跃窗口
COMPACT TABLE [db.]table_name
# 或者
COMPACT TABLE [db.]table_name FOR PAST

# 压缩当前窗口
COMPACT TABLE [db.]table_name FOR CURRENT
```


## COMPACT PARTITION
压缩指定的 partition,可以指定压缩的目标时间窗口。
**语法**
```SQL
# 压缩非活跃窗口
COMPACT PARTITION partition_id
# 或者
COMPACT PARTITION partition_id FOR PAST

# 压缩当前窗口
COMPACT PARTITION partition_id FOR CURRENT
```
20 changes: 20 additions & 0 deletions en_US/sql-reference/statements/flush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## FLUSH TABLE
将指定 table 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH TABLE [db.]table_name
```

## FLUSH DATABASE
将指定 database 所有 table 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH DATABASE db
```

## FLUSH NODE
将指定集群节点上的 partition 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH NODE name
```
26 changes: 26 additions & 0 deletions zh_CN/sql-reference/statements/compact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## COMPACT TABLE
压缩指定的 table,可以指定压缩的目标时间窗口。
**语法**
```SQL
# 压缩非活跃窗口
COMPACT TABLE [db.]table_name
# 或者
COMPACT TABLE [db.]table_name FOR PAST

# 压缩当前窗口
COMPACT TABLE [db.]table_name FOR CURRENT
```


## COMPACT PARTITION
压缩指定的 partition,可以指定压缩的目标时间窗口。
**语法**
```SQL
# 压缩非活跃窗口
COMPACT PARTITION partition_id
# 或者
COMPACT PARTITION partition_id FOR PAST

# 压缩当前窗口
COMPACT PARTITION partition_id FOR CURRENT
```
20 changes: 20 additions & 0 deletions zh_CN/sql-reference/statements/flush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## FLUSH TABLE
将指定 table 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH TABLE [db.]table_name
```

## FLUSH DATABASE
将指定 database 所有 table 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH DATABASE db
```

## FLUSH NODE
将指定集群节点上的 partition 的内存数据刷到磁盘上。
**语法**
```SQL
FLUSH NODE name
```

0 comments on commit 18194b9

Please sign in to comment.