US2016232186A1PendingUtilityA1

Method and system for database partition

53
Assignee: IBMPriority: Apr 30, 2009Filed: Apr 18, 2016Published: Aug 11, 2016
Est. expiryApr 30, 2029(~2.8 yrs left)· nominal 20-yr term from priority
G06F 17/30339G06F 17/30454G06F 17/30477G06F 17/30315G06F 16/24537G06F 16/278G06F 16/24554G06F 16/2455G06F 16/2282G06F 16/221
53
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

The present invention provides a flexible, dynamic database partition method and system. The method includes the steps of acquiring a data partition rule, where the data partition rule is used to identify a first relationship between a data partition condition and a database partition; establishing a second relationship between the data partition condition and a data partition key based on the data partition rule and a third relationship between the database partition and the data partition key; adding the data partition key to a data item where the data item is stored in the database based on the second relationship between the data partition condition and the data partition key; and storing the data item in the database partition based on the data partition key of the data item.

Claims

exact text as granted — not AI-modified
1 . A computer program product for partitioning data stored in a database, the computer program product comprising:
 a storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
 acquiring at least one data partition rule from a set of data partition rules stored in the database, wherein the set of data partition rules comprises at least one rule defined based on at least one of
 data query frequency in the database, and 
 feedback information comprising statistical information associated with data queries performed on the database, each rule of the set of data partition rules comprises at least one data partition condition for a given database partition of the database, the at least one data partition condition indicates at least one condition to be satisfied by data items for association with the given database partition; 
 
 identifying, based on the data partition rule, a data partition key associated with the given database partition; 
 associating, based on the identifying, the data partition key with the data partition condition; 
 determining that at least one data item stored in the database satisfies the at least one condition of the at least one data partition condition; 
 adding, based on the determining, the data partition key associated with the at least one data partition condition to the data item, wherein the adding comprises adding a column comprising the data partition key to at least one data item table in the database comprising the data item; and 
 storing, based on the adding, the data item in the given database partition according to the data partition key of the data item. 
   
     
     
         2 . The computer program product according to  claim 1 , wherein the associating comprises:
 recording the at least one data partition condition and the data partition key associated therewith into a match table.   
     
     
         3 . The computer program product according to  claim 2 , wherein the adding comprises:
 executing a data query, wherein the data query is based on the at least one data partition condition;   obtaining the data item from a result of the executing the data query;   querying the match table to acquire the data partition key associated with the at least one data partition condition; and   adding the data partition key to the data item.   
     
     
         4 . The computer program product according to  claim 2 , wherein the adding comprises:
 retrieving the at least one data item from the database;   retrieving the data partition condition based on a set of parameters associated with the at least one data item;   querying the match table to acquire the data partition key associated with the data partition condition; and   adding the data partition key to the data item.   
     
     
         5 . The computer program product according to  claim 2 , wherein the match table is stored in a cache. 
     
     
         6 . The computer program product according to  claim 1 , wherein the method further comprises:
 pre-calculating the data partition key.   
     
     
         7 . The computer program product according to  claim 6 , wherein the pre-calculating comprises:
 creating a given table in the database;   inserting the data partition key into the given table; and   querying the database for a partition number which corresponds to the data partition key.   
     
     
         8 . The computer program product according to  claim 1 , wherein the method further comprises:
 assigning a partition number to the given database partition; and   relating the data partition key to the partition number.   
     
     
         9 . The computer program product according to  claim 1 , wherein the method further comprises:
 acquiring a new data item from the database;   adding a given data partition key to the new data item according to a data partition condition comprising one or more conditions satisfied by the new data item; and   storing, based on the given data partition key added to the new data item, the new data item in a partition of the database corresponding to the given data partition key added to the new data item.   
     
     
         10 . A computer program product for utilizing at least one computer processor for querying a database, the computer program product comprising:
 a storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
 acquiring a data query request; 
 parsing the data query request; 
 identifying, based on the parsing, at least one column value of the data query request; 
 comparing the column value to a set of data partition rules stored in the database, wherein each rule of the set of data partition rules comprises at least one data partition condition for a given database partition of the database, the data partition condition indicates at least one condition to be satisfied by data items for association with the given database partition, and each rule of the set of data partition rules further comprises an identifier of the given database partition and is separate and distinct from the given database partition; 
 determining, based on the comparing, if the column value satisfies at least one data partition condition of at least one data partition rule in the set of data partition rules; and 
 based on the column value satisfying the at least one data partition condition,
 identifying a data partition key from the at least one data partition rule comprising the at least one data partition condition that has been satisfied 
 modifying, prior to processing the data query request against the database, the data query request to include the data partition key, the modifying comprising adding at least one predicate to the data query request comprising the data partition key; and 
 sending the data query request comprising the data partition key to the database. 
 
   
     
     
         11 . The computer program product of  claim 10 , wherein the method further comprises:
 based on the column value failing to satisfy the at least one data partition condition, sending the data query request without any data partition keys to the database.   
     
     
         12 . The computer program product of  claim 10 , wherein sending the data query request comprising the data partition key to the database limits a search performed based on the data query request to a database partition associated with the data partition key. 
     
     
         13 . The computer program product according to  claim 10 , wherein identifying a data partition key comprises:
 searching a match table comprising relationships between data partition conditions and data partition keys.   
     
     
         14 . The computer program product according to  claim 10 , wherein the method further comprises:
 recording feedback information of the data query request.   
     
     
         15 . The computer program product according to  claim 14 , wherein the feedback information comprises one of a
 data query condition in the data query request,   a number of data items returned from the database according to the data query condition,   a response time for returning the data item, and   a partition queried.   
     
     
         16 . An information processing system for partitioning data stored in a database, the information processing system comprising:
 a processor implemented at least partially by hardware;   a memory communicatively coupled to the processor; and   a data partitioning system communicatively coupled to the processor and the memory, wherein the data partitioning system is configured to perform a method comprising:
 acquiring a data query request; 
 parsing the data query request; 
 identifying, based on the parsing, at least one column value of the data query request; 
 comparing the column value to a set of data partition rules stored in the database, wherein each rule of the set of data partition rules comprises at least one data partition condition for a given database partition of the database, the data partition condition indicates at least one condition to be satisfied by data items for association with the given database partition, and each rule of the set of data partition rules further comprises an identifier of the given database partition and is separate and distinct from the given database partition; 
 determining, based on the comparing, that the column value satisfies at least one the data partition condition of at least one data partition rule in the set of data partition rules; 
 identifying, based on the determining, a data partition key from the at least one data partition rule comprising the at least one data partition condition that has been satisfied; 
 modifying, prior to processing the data query request against the database, the data query request to include the data partition key, the modifying comprising adding at least one predicate to the data query request comprising the data partition key; and 
 sending the data query request comprising the data partition key to the database. 
   
     
     
         17 . The information processing system of  claim 16 , wherein the method further comprises:
 based on the column value failing to satisfy the at least one data partition condition, sending the data query request without any data partition keys to the database.   
     
     
         18 . The information processing system of  claim 16 , wherein sending the data query request comprising the data partition key to the database limits a search performed based on the data query request to a database partition associated with the data partition key. 
     
     
         19 . The information processing system of  claim 16 , wherein identifying a data partition key comprises:
 searching a match table comprising relationships between data partition conditions and data partition keys.   
     
     
         20 . The information processing system of  claim 16 , wherein the method further comprises:
 recording feedback information of the data query request, wherein the feedback information comprises one of a
 data query condition in the data query request, 
 a number of data items returned from the database according to the data query condition, 
 a response time for returning the data item, and 
 a partition queried.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.