In a shared nothing architecture, each machine in a database cluster owns a portion of the data stored in the database cluster. This ownership is controlled by data partitioning. This data ownership needs to be altered in certain scenarios. For example, a business may need to expand the capacity of its database by adding more physical machines when the capacity of the database does not meet present or future need or when the existing data distribution does not meet business requirements.
When data ownership needs to be changed, existing data needs to be redistributed among machines in an operation referred to as data redistribution. The data redistribution operation becomes more frequent with data warehouse customers as the amount of data accumulates over time. In addition, as acquisitions and merges are becoming more popular, the need for more capacity also increases.
After data redistribution, data ownership is changed. As a result, records are moved from the sending machine to the receiving machine. After the records are removed from the sending machine, free space is left in the sending partition. This free space not only unnecessarily takes up storage but may also result in sub-optimal query performance. Therefore, another database operation referred to as table reorganization may be performed to utilize the free space. As a result, the overall cost of data redistribution in terms of both time, storage, and usability is negatively impacted by requiring table reorganization operations. This is an additional step that requires addition time and system resources to execute.
Accordingly, what is needed is an improved method and system for redistributing data. The present invention addresses such a need.