Method and apparatus for using a hash-partitioned index to access a table that is not partitioned or partitioned independently of the hash partitioned index
First Claim
1. A method for using an index that is hash-partitioned to access a table that is not hash partitioned, executed by at least one or more processors, the method comprising:
- receiving a request at a database system to perform an operation involving the table that is not hash-partitioned;
looking up a key in the hash-partitioned index by;
applying a hash function to the key to identify a unique index partition; and
using the key to perform a lookup in the identified index partition to identify a row of the table that matches the key;
adding one or more partitions to the hash-partitioned index by subdividing a source index partition to create two new partitions and creating a set of new partitions to replace a set of existing partitions in the hash-partitioned index, wherein the set of new partitions is more than the set of existing partitions;
scanning through all rows in the table;
obtaining a second key for each row in the table;
applying a new hash function to the obtained second key to identify a unique partition within the two new partitions and the set of new partitions for the obtained second key;
inserting the obtained second key into the identified partition;
replacing the source partition with the two new partitions; and
replacing the existing set of partitions with the new set of partitions.
1 Assignment
0 Petitions
Accused Products
Abstract
One embodiment of the present invention provides a system that uses an index that is hash-partitioned to access a table that is not hash-partitioned. During system operation, the database receives a request to perform an operation involving a table in the database. If performing the operation involves looking up a key in the hash-partitioned index, the database applies a hash function to the key to identify a unique partition within the hash-partitioned index for the key, and uses the key to perform a lookup in the identified partition to identify zero or more rows of the table that match the key.
61 Citations
42 Claims
-
1. A method for using an index that is hash-partitioned to access a table that is not hash partitioned, executed by at least one or more processors, the method comprising:
-
receiving a request at a database system to perform an operation involving the table that is not hash-partitioned; looking up a key in the hash-partitioned index by; applying a hash function to the key to identify a unique index partition; and using the key to perform a lookup in the identified index partition to identify a row of the table that matches the key; adding one or more partitions to the hash-partitioned index by subdividing a source index partition to create two new partitions and creating a set of new partitions to replace a set of existing partitions in the hash-partitioned index, wherein the set of new partitions is more than the set of existing partitions; scanning through all rows in the table; obtaining a second key for each row in the table; applying a new hash function to the obtained second key to identify a unique partition within the two new partitions and the set of new partitions for the obtained second key; inserting the obtained second key into the identified partition; replacing the source partition with the two new partitions; and replacing the existing set of partitions with the new set of partitions. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 27)
-
-
15. A non-transitory computer readable storage medium storing instructions that when executed by a computer cause the computer to perform a method that uses a hash partitioned index to access a table that is not hash partitioned, the method comprising:
-
receiving a request at a database system to perform an operation involving the table that is not hash-partitioned; looking up a key in the hash-partitioned index by; applying a hash function to the key to identify a unique index partition; and using the key to perform a lookup in the identified index partition to identify a row of the table that matches the key; adding one or more partitions to the hash-partitioned index by subdividing a source index partition to create two new partitions and creating a set of new partitions to replace a set of existing partitions in the hash-partitioned index, wherein the set of new partitions is more than the set of existing partitions; scanning through all rows in the table; obtaining a second key for each row in the table; applying a new hash function to the obtained second key to identify a unique partition within the two new partitions and the set of new partitions for the obtained second key; inserting the obtained second key into the identified partition; replacing the source partition with the two new partitions; and replacing the existing set of partitions with the new set of partitions. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28)
-
-
29. An apparatus for using an index that is hash-partitioned to access a table that is not hash-partitioned comprising:
-
a database system; a processor; a receiving mechanism that receives requests to perform an operation involving a table in the table that is not hash-partitioned; a lookup mechanism that looks up a key in the hash-partitioned index by;
applying the hash function to the key to identify a unique index partition, and use the key to perform a lookup in the identified index partition to identify a row of the table that matches the key; anda index-partition adding mechanism that adds one or more partitions to the hash partitioned index by subdividing a source index partition to create two new partitions and creating a set of new partitions to replace a set of existing partitions in the hash-partitioned index, wherein the set of new partitions is more than the set of existing partitions, and wherein the index-partition added mechanism is further configured to; scanning through all rows in the table; obtaining a second key for each row in the table; applying a new hash function to the obtained second key to identify a unique partition within the two new partitions and the set of new partitions for the obtained second key; inserting the obtained second key into the identified partition; replacing the source partition with the two new partitions; and
replacing the existing set of partitions with the new set of partitions. - View Dependent Claims (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)
-
Specification