IP Library › Granted Patent US 10,248,706
Granted Patent B2
US 10,248,706 · App. 15/281,639 · Granted Apr 2, 2019

Replicating database updates with batching

Inventor: Phillip R. Koza (San Jose, CA)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F17/30575G06F17/30368G06F17/30377
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 10,248,706
App. No.
15/281,639
Granted
Apr 2, 2019
Kind
B2
Abstract

A computer-implemented method includes detecting a source update applied to a source table, where the source table includes a plurality of columns, and where the source update modifies a first subset of columns of the plurality of columns. A second subset of columns of the plurality of columns is determined, by a computer processor. The second subset of columns has more columns than the first subset of columns and fewer columns than the plurality of columns. Determining the second subset of columns includes determining which of the plurality of columns were updated most recently. The second subset of columns is included in a set clause of an update statement for updating a target table, where the target table is or includes a replica of the source table. The update statement is applied to the target table to achieve at least a minimum batching percentage within a plurality of update statements.

Claims (28)

1. A system comprising:

a memory having computer readable instructions; and

one or more processors for executing the computer readable instructions to perform:

determining a minimum batching percentage for a source table;

determining a change threshold based on the minimum batching percentage;

detecting a source update applied to the source table, wherein the source table comprises a plurality of columns, and wherein the source update modifies a first subset of columns of the plurality of columns;

determining a second subset of columns of the plurality of columns, wherein the determining the second subset of columns comprises determining which of the plurality of columns were updated most recently, and wherein a respective tracking count of each column in the second subset of columns is less than or equal to the change threshold;

including the second subset of columns in a set clause of an update statement for updating a target table, wherein the second subset of columns included in the set clause comprise more columns than the first subset of columns modified by the source update, wherein the second subset of columns comprise fewer columns than the plurality of columns in the source table, and wherein the target table comprises a replica of the source table;

wherein the change threshold is a number of times a column that has been updated at least once is allowed to be unchanged by an update before the column is not included in the set clause; and

updating one or more columns of the target table responsive to the source update at the source table by applying the update statement to the target table to achieve at least the minimum batching percentage within a plurality of update statements;

wherein the applying the update statement comprises batching the update statement with a set of one or more previous update statements applicable to the target table, and wherein the minimum batching percentage is a guaranteed minimum percentage of update statements batched together when the plurality of update statements are performed in sequence, uninterrupted by other database operations.

2. The system of claim 1 , wherein the determining which of the plurality of columns were updated most recently comprises: updating tracking data based on the source update, wherein the tracking data comprises a plurality of tracking counts, comprising a tracking count associated with each column of the plurality of columns; wherein the tracking count associated with each column indicates how many times the source table has been updated since the column was last updated.

3. The system of claim 1 , wherein the determining the change threshold is further based on a size of the source table.

4. The system of claim 1 , wherein the determining the minimum batching percentage is based at least in part on how many of the plurality of columns are expensive to update.

5. The system of claim 1 , the one or more processors for executinq the computer readable instructions to perform: reordering a plurality of operations applicable to the target database, wherein the target table is at least a portion of the target database, to group a plurality of updates together to enable batching to occur on the plurality of updates.

6. A computer-program product for replicating database updates, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:

determining a minimum batching percentage for a source table;

determining a change threshold based on the minimum batching percentage;

detecting a source update applied to the source table, wherein the source table comprises a plurality of columns, and wherein the source update modifies a first subset of columns of the plurality of columns;

determining a second subset of columns of the plurality of columns, wherein the determining the second subset of columns comprises determining which of the plurality of columns were updated most recently, and wherein a respective tracking count of each column in the second subset of columns is less than or equal to the change threshold;

including the second subset of columns in a set clause of an update statement for updating a target table, wherein the second subset of columns included in the set clause comprise more columns than the first subset of columns modified by the source update, wherein the second subset of columns comprise fewer columns than the plurality of columns in the source table, and wherein the target table comprises a replica of the source table;

wherein the change threshold is a number of times a column that has been updated at least once is allowed to be unchanged by an update before the column is not included in the set clause; and

updating one or more columns of the target table responsive to the source update at the source table by applying the update statement to the target table to achieve at least the minimum batching percentage within a plurality of update statements;

wherein the applying the update statement comprises batching the update statement with a set of one or more previous update statements applicable to the target table, and wherein the minimum batching percentage is a guaranteed minimum percentage of update statements batched together when the plurality of update statements are performed in sequence, uninterrupted by other database operations.

7. The computer-program product of claim 6 , wherein the determining which of the plurality of columns were updated most recently comprises: updating tracking data based on the source update, wherein the tracking data comprises a plurality of tracking counts, comprising a tracking count associated with each column of the plurality of columns; wherein the tracking count associated with each column indicates how many times the source table has been updated since the column was last updated.

8. The computer-program product of claim 6 , wherein the determining the change threshold is based on the minimum batching percentage and further based on a size of the source table.

9. The computer-program product of claim 6 , the method further comprising wherein the determining the minimum batching percentage is based at least in part on how many of the plurality of columns are expensive to update.

10. The computer-program product of claim 6 , the method further comprising reordering a plurality of operations applicable to the target database, wherein the target table is at least a portion of the target database, to group the plurality of updates together to enable batching to occur on the plurality of updates.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 30, 2016
From: KOZA, PHILLIP R.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 039909/0752 →
Continuity (1)
Related Publication 20180096041A1 · Apr 5, 2018