Computer systems generally include one or more processors interfaced to a temporary data-storage device such as a memory device and one or more persistent data-storage devices such as disk drives. Each disk drive generally has an associated disk controller. Data is transferred between the disk drives and the disk controllers. Data is also transferred between the disk controller(s) and the memory device over a communications bus or similar.
Data organization in a computer system such as that above is important in relational database systems that deal with complex queries against large volumes of data. Relational database systems allow data to be stored in tables that are organized as both a set of columns and a set of rows. Standard commands are used to define the columns and rows of tables and data is subsequently entered in accordance with the defined structure.
The defined table structure is locally maintained but may not correspond to the physical organization of the data. In a parallel shared nothing relational database data can be stored across multiple data-storage facilities, each data-storage facility in turn including one or more disk drives. Data partitioning can be performed in order to enhance parallel processing across multiple data-storage facilities. The intent behind data partitioning is to evenly distribute the data among all computational elements such that performance scales linearly as more computational elements are added. The database could be hash partitioned, range partitioned, round-robin partitioned or not partitioned at all.
Hash partitioning is a partitioning scheme in which a predefined hash function and map is used to assign rows in a table to respective processing modules and data-storage facilities. The hashing function generates a hash or partition bucket number and the partition numbers are mapped to data-storage facilities. Range partitioning is a partitioning scheme in which each data-storage facility manages the records falling within a range of values. Round Robin partitioned is a partitioning scheme where the data-storage facility is picked in a round robin fashion. No partitioning means that a single data-storage facility manages all of the rows.
One drawback of current systems is that the mapping of partitions to the data-storage facilities on which the rows are stored is often required to be physically defined in advance especially when the mapping is not to all the data-storage facilities but to a subset of them. The mapping of partitions to data-storage facilities is therefore static. A static mapping to specific user defined data-storage facilities often leads to uneven distribution of rows over the data-storage facilities. This in turn has the potential to increase the execution time for complex queries.
Users of relational database systems require the minimum time possible for execution of complex queries against large amounts of data. In a parallel shared nothing relational database system it is often important to evenly allocate both table rows and free space across multiple data-storage facilities.