IP Library › Granted Patent US 9,189,506
Granted Patent B2
US 9,189,506 · App. 13/371,577 · Granted Nov 17, 2015

Database index management

Inventors: Ying Ming Gao (Beijing, CN); Jia Huo (Beijing, CN); Kai Zhang (Beijing, CN); Xian Zou (Beijing, CN)
Assignee: International Business Machines Corporation
G06F17/30312G06F17/3002G06F17/30017G06F17/30097G06F17/30619G06F17/30769
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,189,506
App. No.
13/371,577
Granted
Nov 17, 2015
Kind
B2
Abstract

Managing database indexes includes creating a main index and creating at least one service index that is configured for recording a change to a node to be updated in the main index. Managing database indexes also includes detecting whether an operation that involves the main index and is performed on the database appears in the database, and maintaining the main index using at least one service index in response to the operation that involves the main index and is performed on the database, appearing in the database. The maintaining is performed based on changes to a node to be updated in the main index that are recorded in the at least one service node.

Claims (42)

1. A method of managing database indexes, comprising:

creating a main index for a database, wherein the main index is used for storing records of the database;

creating, by a computer, at least one service index configured for recording changes to be made to a node in the main index, wherein the service index includes a service node that comprises node information that is associated with the node of the main index and a type of operation that is performed on the node of the main index, wherein the type of operation includes one of a data manipulation operation, an insert operation or a delete operation;

detecting whether an operation that involves the main index and is performed on the database appears in the database;

maintaining the main index by using the at least one service index, in response to detecting the operation that involves the main index and is performed on the database appearing in the database, the maintaining performed based on changes to the node in the main index that are recorded in the service node of the service index;

responsive to performing a data query operation, obtaining a query result by merging result sets by integrating nodes from the service index and the main index that have identical node information into one node based on the type of operation, the result sets obtained by querying the main index and the at least one service index;

updating the main index and the at least one service index in parallel, in response to performing the data manipulation operation by:

terminating updating other service indexes that have not been successfully updated after one of the at least one service index has been successfully updated first;

continuing updating the main index; and

deleting nodes that have been previously successfully updated from service indexes that have been successfully updated when the main index has been successfully updated.

2. The method according to claim 1 , further comprising:

indicating that the data manipulation operation ends, in response to any one of the at least one service index and the main index having been successfully updated.

3. The method according to claim 2 , wherein the updating the main index and the at least one service index in parallel comprises:

terminating the updating of the at least one service index after the main index has been successfully updated first.

4. An apparatus for managing database indexes, comprising:

a first creating module configured to create a main index for a database, wherein the main index is used for storing records of the database;

a second creating module configured to create at least one service index, the at least one service index comprising a service node for recording changes to be made to a node in the main index, wherein the service node in the at least one service index comprises node information that is associated with the node of the main index and a type of operation that is performed on the node of the main index, wherein the type of operation includes one of a data manipulation operation, an insert operation or a delete operation;

a detecting module configured to detect whether an operation that involves the main index and is performed on the database appears in the database;

an indexing module configured to maintain the main index by using the at least one service index, in response to detecting the operation that involves the main index and is performed on the database appearing in the database, the maintaining performed based on changes to the node in the main index that are recorded in the service node of the service index;

a manipulating module configured to update the main index and the at least one service index in parallel, in response to performing the data manipulation operation by:

terminating updating other service indexes that have not been successfully updated after one of the at least one service index has been successfully updated first:

continuing updating the main index; and

deleting nodes that have been previously successfully updated from service indexes that have been successfully updated when the main index has been successfully updated, and

wherein the query module comprises a module configured to obtain a query result by merging result sets by integrating nodes from the service index and the main index that have identical node information into one node based on the type of operation, the result sets are obtained by querying the main index and the at least one service index when the data query operation is performed.

5. The apparatus according to claim 4 , wherein the indexing module comprises

a query module configured to obtain a query result in a data query operation that is performed on the database.

6. The apparatus according to claim 5 , wherein the manipulating module

is further configured to indicate that the data manipulation operation ends, in response to any one of the at least one service index and the main index having been successfully updated.

7. The apparatus according to claim 6 , wherein the module configured to update the main index and the at least one service index in parallel comprises:

a module configured to terminate the updating of the at least one service index after the main index has been successfully updated first.

8. A computer program product for managing database indexes, the computer program product for managing database indexes, the computer program product comprising a computer readable storage medium having computer readable program code embodied therewith, which when executed by a computer cause the computer to implement a method, the method comprising:

creating a main index for a database, wherein the main index is used for storing records of the database;

creating at least one service index comprising a service node configured for recording changes to be made to a node in the main index, wherein the service node comprises node information that is associated with the node of the main index and a type of operation that is performed on the node in the main index, wherein the type of operation includes one of a data manipulation operation, an insert operation or a delete operation;

detecting whether an operation that involves the main index and is performed on the database appears in the database;

maintaining the main index by using the at least one service index, in response to detecting the operation that involves the main index and is performed on the database appearing in the database, the maintaining performed based on changes to a node to be updated in the main index that are recorded in the service node of the service index,

responsive to performing a data query operation, obtaining a query result by merging result sets by integrating nodes from the service index and the main index that have identical node information into one node based on the type of operation, the result sets obtained by querying the main index and the at least one service index;

updating the main index and the at least one service index in parallel, in response to performing the data manipulation operation by:

terminating updating other service indexes that have not been successfully updated after one of the at least one service index has been successfully updated first;

continuing updating the main index; and

deleting nodes that have been previously successfully updated from service indexes that have been successfully updated when the main index has been successfully updated.

9. The computer program product according to claim 8 , wherein the computer readable program code further causes the computer to implement

indicating that the data manipulation operation ends, in response to any one of the at least one service index and the main index having been successfully updated.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 13, 2012
From: GAO, YING MING; HUO, JIA; ZHANG, KAI; ZOU, XIAN
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 027691/0809 →
Priority Claims (1)
CN 2011 1 0051574 · Feb 28, 2011 · national
Continuity (1)
Related Publication 20120221534A1 · Aug 30, 2012