The SET_TABLEGROUP_BALANCE_WEIGHT procedure is used to set the weight of a SHARDING NONE table group.
Note
This procedure is introduced in OBServer V4.4.1.
Syntax
DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(
weight INT,
tablegroup_name VARCHAR(65535)
);
Parameters
| Parameter | Description |
|---|---|
| weight | The weight of the table group (an integer), in the range [1, +∞). A higher weight means a higher proportion of resources allocated. |
| tablegroup_name | The name of the table group. |
Considerations
DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT is used to set the weight of a SHARDING NONE table group.
If
enable_database_sharding_none = true, the default weight of the bind table group created with a new database is 1. The weight of other unconfiguredSHARDING NONEtable groups is 0 by default, so they do not participate in weight balancing.The weights of tables and partitions within a weighted table group are ineffective.
We recommend that you divide the weights of table groups into three tiers at most:
- High weight =
SHARDING NONEtable group total count * 100% - Middle weight =
SHARDING NONEtable group total count * 50% - Low weight = 1
- High weight =
Examples
Call this procedure in the sys tenant to set the weight of the
TG_TD_testtable group under themysqltenant to 10.obclient> CALL DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(10, 'TG_TD_test') TENANT = 'mysql';Call this procedure in a user tenant to set the weight of the
TG_TD_testtable group to 10.obclient> CALL DBMS_BALANCE.SET_TABLEGROUP_BALANCE_WEIGHT(10, 'TG_TD_test');
References
- For information about deleting the weights of
SHARDING NONEtable groups, see CLEAR_TABLEGROUP_BALANCE_WEIGHT. - For information about querying the weights of different table groups, see oceanbase.CDB_OB_DATABASES or oceanbase.DBA_OB_DATABASES.
- For information about whether to enable auto-aggregation for user tables when creating a database, see enable_database_sharding_none.