mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 22:02:56 +00:00
feat: flush or compact table and region functions (#3363)
* feat: adds Requester to process table flush and compaction request * feat: admin_fn macros for administration functions * test: add query result * feat: impl flush_region, flush_table, compact_region, and flush_region functions * docs: add Arguments to admin_fn macro * chore: apply suggestion Co-authored-by: Zhenchi <zhongzc_arch@outlook.com> * chore: apply suggestion Co-authored-by: Zhenchi <zhongzc_arch@outlook.com> * fix: group_requests_by_peer and adds log * Update src/common/macro/src/admin_fn.rs Co-authored-by: Ruihang Xia <waynestxia@gmail.com> * feat: adds todo for spawan thread * feat: rebase with main --------- Co-authored-by: Zhenchi <zhongzc_arch@outlook.com> Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
--- test flush_region and compact_region ---
|
||||
|
||||
CREATE TABLE my_table (
|
||||
a INT PRIMARY KEY,
|
||||
b STRING,
|
||||
ts TIMESTAMP TIME INDEX,
|
||||
)
|
||||
PARTITION ON COLUMNS (a) ();
|
||||
|
||||
INSERT INTO my_table VALUES
|
||||
(1, 'a', 1),
|
||||
(2, 'b', 2),
|
||||
(11, 'c', 3),
|
||||
(12, 'd', 4),
|
||||
(21, 'e', 5),
|
||||
(22, 'f', 5);
|
||||
|
||||
SELECT * FROM my_table;
|
||||
|
||||
SELECT flush_region(greptime_partition_id) from information_schema.partitions WHERE table_name = 'my_table';
|
||||
|
||||
SELECT compact_region(greptime_partition_id) from information_schema.partitions WHERE table_name = 'my_table';
|
||||
|
||||
SELECT * FROM my_table;
|
||||
|
||||
DROP TABLE my_table;
|
||||
Reference in New Issue
Block a user