ADMIN
ADMIN is used to run administration functions.
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.
- reconcile_table(table_name)to reconcile the metadata inconsistency of a table, read table reconciliation for more details.
- reconcile_database(database_name)to reconcile the metadata inconsistency of all tables in a database, read table reconciliation for more details.
- reconcile_catalog()to reconcile the metadata inconsistency of all tables in the entire cluster, read table reconciliation for more details.
For example:
-- Flush the table test --
admin flush_table("test");
-- Schedule a compaction for table test --
admin compact_table("test");