# US 2013/0159248 A1 · Merge monitor for table delta partitions

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0159248 A1
- Document ID: US20130159248A1
- Status: Published application
- Kind: A1
- Application number: 13/332,151
- Filed: 2011-12-20
- Published: 2013-06-20
- Earliest claimed: 2011-12-20
- Assignees: Sap SE
- Inventors: Klaus Otto Mueller
- Web page: https://patentgrep.com/patent/US20130159248A1

## CPC

- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/00: Information retrieval; Database structures therefor; File system structures therefor
- G06F 16/2453: Query optimisation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

At runtime first and second cost functions associated with a request for a merge of a main partition of a table with a delta partition of the table can be calculated. The first and second cost functions can respectively quantify an urgency of the merge relative to availability of system resources required to perform the merge and an urgency of the merge relative to other merges. Determining whether the merge should occur can include comparing the calculated first and second cost functions with calculations of other first and second cost functions for other merge requests of one or more other tables. If the merge should occur, a merge thread can be assigned to execute the merge, and execution of the merge by the merge thread can be commenced if at least one merge token representing system resources usable for merge operations is available.

## Claims

### Claim 1

A computer program product comprising a machine-readable medium storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
calculating, at runtime, a first cost function and a second cost function associated with a request for a merge of a main partition of a table with a delta partition of the table, the table being part of a database that comprises a plurality of other tables, the request for the merge being prompted by occurrence of a merge motivation, the first cost function quantifying an urgency of the merge relative to availability of system resources required to perform the merge, the second cost function quantifying the urgency of the merge relative to other merges;
determining whether the merge should occur, the determining comprising comparing the calculated first and second cost functions with calculations of other first and second cost functions for other merge requests of one or more other tables;
assigning, upon determining that the merge should occur, a merge thread to execute the merge;
determining an availability of one or more merge tokens to assign to the merge thread, the one or more merge tokens representing system resources usable for merge operations; and
commencing execution of the merge by the merge thread if at least one merge token is available or adding the merge thread to a merge queue to await an available merge token if the at least one merge token is not available.

### Claim 2 (depends on 1)

A computer program product as in claim 1, wherein the second cost function is predefined for one merge motivation of a plurality of merge motivations and is based at least in part on one or more merge criteria related to the one merge motivation.

### Claim 3 (depends on 2)

A computer program product as in claim 2, wherein the one or more merge criteria comprise predefined categories with user-configurable thresholds based on business knowledge of an organization using the database, and wherein the merge criteria comprise one or more of a size of the delta partition, an age of the delta partition since a last previous merge, a log size of the delta partition, a relation in size between the main partition and the delta partition, and a cell count of the table.

### Claim 4 (depends on 1)

A computer program product as in claim 1, wherein the merge queue comprises a plurality of queued merge threads waiting execution of an associated merge, each associated merge having an associated first cost function and an associated second cost function, the plurality of queued merges being ordered in the merge queue according to the associated first cost function and the associated second cost function for each of the merges.

### Claim 5 (depends on 1)

A computer program product as in claim 1, wherein each of the at least one merge token represents a unit of central processing unit capacity available to be dedicated to execution of the merge thread.

### Claim 6

A system comprising:
at least one programmable processor; and
a machine-readable medium storing instructions that, when executed by the at least one processor, cause the at least one programmable processor to perform operations comprising:
calculating, at runtime, a first cost function and a second cost function associated with a request for a merge of a main partition of a table with a delta partition of the table, the table being part of a database that comprises a plurality of other tables, the request for the merge being prompted by occurrence of a merge motivation, the first cost function quantifying an urgency of the merge relative to availability of system resources required to perform the merge, the second cost function quantifying the urgency of the merge relative to other merges;
determining whether the merge should occur, the determining comprising comparing the calculated first and second cost functions with calculations of other first and second cost functions for other merge requests of one or more other tables;
assigning, upon determining that the merge should occur, a merge thread to execute the merge;
determining an availability of one or more merge tokens to assign to the merge thread, the one or more merge tokens representing system resources usable for merge operations; and
commencing execution of the merge by the merge thread if at least one merge token is available or adding the merge thread to a merge queue to await an available merge token if the at least one merge token is not available.

### Claim 7 (depends on 6)

A system as in claim 6, wherein the second cost function is predefined for one merge motivation of a plurality of merge motivations and is based at least in part on one or more merge criteria related to the one merge motivation.

### Claim 8 (depends on 7)

A system as in claim 7, wherein the one or more merge criteria comprise predefined categories with user-configurable thresholds based on business knowledge of an organization using the database, and wherein the merge criteria comprise one or more of a size of the delta partition, an age of the delta partition since a last previous merge, a log size of the delta partition, a relation in size between the main partition and the delta partition, and a cell count of the table.

### Claim 9 (depends on 6)

A system as in claim 6, wherein the merge queue comprises a plurality of queued merge threads waiting execution of an associated merge, each associated merge having an associated first cost function and an associated second cost function, the plurality of queued merges being ordered in the merge queue according to the associated first cost function and the associated second cost function for each of the merges.

### Claim 10 (depends on 6)

A system as in claim 6, wherein each of the at least one merge token represents a unit of central processing unit capacity available to be dedicated to execution of the merge thread.

### Claim 11

A computer-implemented method comprising:
calculating, at runtime, a first cost function and a second cost function associated with a request for a merge of a main partition of a table with a delta partition of the table, the table being part of a database that comprises a plurality of other tables, the request for the merge being prompted by occurrence of a merge motivation, the first cost function quantifying an urgency of the merge relative to availability of system resources required to perform the merge, the second cost function quantifying the urgency of the merge relative to other merges;
determining whether the merge should occur, the determining comprising comparing the calculated first and second cost functions with calculations of other first and second cost functions for other merge requests of one or more other tables;
assigning, upon determining that the merge should occur, a merge thread to execute the merge;
determining an availability of one or more merge tokens to assign to the merge thread, the one or more merge tokens representing system resources usable for merge operations; and
commencing execution of the merge by the merge thread if at least one merge token is available or adding the merge thread to a merge queue to await an available merge token if the at least one merge token is not available.

### Claim 12 (depends on 11)

A computer-implemented method as in claim 11, wherein the second cost function is predefined for one merge motivation of a plurality of merge motivations and is based at least in part on one or more merge criteria related to the one merge motivation.

### Claim 13 (depends on 12)

A computer-implemented method as in claim 12, wherein the one or more merge criteria comprise predefined categories with user-configurable thresholds based on business knowledge of an organization using the database, and wherein the merge criteria comprise one or more of a size of the delta partition, an age of the delta partition since a last previous merge, a log size of the delta partition, a relation in size between the main partition and the delta partition, and a cell count of the table.

### Claim 14 (depends on 11)

A computer-implemented method as in claim 11, wherein the merge queue comprises a plurality of queued merge threads waiting execution of an associated merge, each associated merge having an associated first cost function and an associated second cost function, the plurality of queued merges being ordered in the merge queue according to the associated first cost function and the associated second cost function for each of the merges.

### Claim 15 (depends on 11)

A computer-implemented method as in claim 11, wherein each of the at least one merge token represents a unit of central processing unit capacity available to be dedicated to execution of the merge thread.

### Claim 16 (depends on 11)

A computer-implemented method as in claim 11, wherein at least one of the calculating, the determining whether the merge should occur, the assigning, the determining the availability of the one or more merge tokens, and the commencing are performed by at least one programmable processor.
