ADMIN

ADMIN is used to run administration functions.

  1. 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 table.
  • compact_table(table_name, [type], [options]) to schedule a compaction task for a table by table name, read 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.
  • 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:

  1. -- Flush the table test --
  2. admin flush_table("test");
  3. -- Schedule a compaction for table test --
  4. admin compact_table("test");