REBALANCE_TABLE
Synchronously rebalances data in the specified table.
A rebalance operation performs the following tasks:
-
Distributes data based on:
- User-defined fault groups, if specified
- Large cluster automatic fault groups
- Redistributes database projection data across all nodes.
Syntax
REBALANCE_TABLE('[[database.]schema.]table‑name')
Parameters
schema |
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
table‑name |
The table to rebalance. |
Privileges
Superuser
When to Rebalance
Rebalancing is useful or even necessary after you perform the following tasks:
- Mark one or more nodes as ephemeral in preparation of removing them from the cluster.
- Add one or more nodes to the cluster so that Vertica can populate the empty nodes with data.
-
Change the scaling factor of an elastic cluster, which determines the number of storage containers used to store a projection across the database.
- Set the control node size or realign control nodes on a large cluster layout
- Add nodes to or remove nodes from a fault group.
By default, before performing a rebalance, Vertica queries system tables to compute the size of all projections involved in the rebalance task. This query can add significant overhead to the rebalance operation. To disable this query, set projection configuration parameter RebalanceQueryStorageContainers to 0.
Example
The following command shows how to rebalance data on the specified table.
=> SELECT REBALANCE_TABLE('online_sales.online_sales_fact'); REBALANCE_TABLE ------------------- REBALANCED (1 row)