1.1.1

Table Of Contents
Pre-Allocating Buckets
As a best pratice, use the SYS.CREATE_ALL_BUCKETS procedure to create the buckets for a partitioned table
before you begin loading data.
SYS.CREATE_ALL_BUCKETS immediately creates the necessary buckets on datastores for partitioned tables.
(Normally SQLFire assigns buckets to servers lazily, as inserts are executed against the table.) Pre-allocating
the buckets ensures that partitioned table data is evenly distributed in the cluster. If you do not use
SYS.CREATE_ALL_BUCKETS, data can become skewed if you rapidly load table data using concurrent
processes.
If a partitioned table becomes skewed, use SYS.REBALANCE_ALL_BUCKETS to rebalance all partitioned
table data in the distributed system.
Rebalancing Partitioned Data on SQLFire Members
You can use rebalancing to dynamically increase or decrease your SQLFire cluster capacity, or to improve the
balance of data across the distributed system.
Rebalancing is a SQLFire member operation that affects partitioned tables created in the cluster. Rebalancing
performs two tasks:
If the a partitioned table's redundancy setting is not satised, rebalancing does what it can to recover redundancy.
See Making a Partitioned Table Highly Available on page 68.
Rebalancing moves the partitioned table's data buckets between host members as needed to establish the best
balance of data across the distributed system.
For efciency, when starting multiple members, trigger the rebalance a single time, after you have added all
members.
Note: If you have transactions running in your system, be careful in planning your rebalancing operations.
Rebalancing may move data between members, which could cause a running transaction to fail with a
TransactionDataRebalancedException.
Start a rebalance operation using one of the following options:
At the command line when you boot a SQLFire server:
sqlf server start -rebalance
Eexecuting a system procedure in a running SQLFire member:
call sys.rebalance_all_buckets();
This procedure initiates rebalancing of buckets across the entire SQLFire cluster for all partitioned tables.
How Partitioned Table Rebalancing Works
The rebalancing operation runs asynchronously.
As a general rule, rebalancing takes place on one partitioned table at a time. For tables that have colocated data,
rebalancing works on the tables as a group, maintaining the data colocation between the tables.
You can continue to access partitioned tables while rebalancing is in progress. Queries, DML operations, and
procedure executions continue while data is moving. If a procedure executes on a local data set, you may see a
performance degradation if that data moves to another member during procedure execution. Future invocations
are routed to the correct member.
For tables that are congured with expiration based on idle time, the rebalancing operation resets the last accessed
time of the table entries on buckets that are moved.
69
Partitioning Tables