# US 2013/0159347 A1 · Automatic and dynamic design of cache groups

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

- Number: US 2013/0159347 A1
- Document ID: US20130159347A1
- Status: Published application
- Kind: A1
- Application number: 13/330,860
- Filed: 2011-12-20
- Published: 2013-06-20
- Earliest claimed: 2011-12-20
- Assignees: Software AG
- Inventors: Joachim KLEIN
- Web page: https://patentgrep.com/patent/US20130159347A1

## CPC

- G06F 16/24552: {Database cache management}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method is provided for automatic and dynamic adaptation of cache groups in a database system having one or more processors. The method includes analyzing a database query and determining if a set of predicates in a predicate pattern are suitable for inclusion in one or more cache groups, with the one or more cache groups having one or more cache tables; mapping value-based predicates in the predicate pattern to a filling column in the one or more cache tables; and mapping equi-join predicates in the predicate pattern to a referential cache constraint in the one or more cache tables. New cache groups can be created for predicate patterns occurring more frequently and existing cache groups can be deleted if the frequency of the predicate pattern falls below a predetermined threshold value.

## Claims

### Claim 1

A method for automatic and dynamic adaptation of cache groups in a database system having one or more processors, the method comprising:
analyzing a database query and determining if a set of predicates in a predicate pattern are suitable for inclusion in one or more cache groups, the one or more cache groups having one or more cache tables;
mapping value-based predicates in the predicate pattern to a filling column in the one or more cache tables; and
mapping equi-join predicates in the predicate pattern to a referential cache constraint in the one or more cache tables, wherein new cache groups are created for predicate patterns occurring more frequently and existing cache groups are deleted if the frequency of the predicate pattern falls below a predetermined threshold value.

### Claim 2 (depends on 1)

A non-transitory computer-readable storage medium having computer readable code embodied therein and capable of being stored in a memory as computer program instructions that, when executed by a computer having one or more processors, at least performs the method for automatic and dynamic adaptation of cache groups of claim 1.

### Claim 3 (depends on 1)

The method of claim 1, wherein the frequency relates to a logical time in which the predicate patterns are occurring.

### Claim 4 (depends on 1)

The method of claim 1, wherein cache groups are federated when the cache groups belong to a same predicate pattern.

### Claim 5 (depends on 1)

The method of claim 1, wherein cache groups are prohibited from further federation when the cache groups belong to a different predicate pattern.

### Claim 6

A method for automatic and dynamic adaptation of cache groups in a database system having one or more processors, the method comprising:
creating an anchored table set configured to hold one or more cache tables;
collecting value-based predicates in a database query;
creating a cache table for each value-based predicate and marking a filling column in each respective cache table;
adding each cache table to the anchored table set;
determining addable referential cache constraints between each cache table in the anchored table set;
determining costs for each addable referential cache constraint;
adding the referential cache constraint based on the determined cost of the respective referential cache constraint;
checking the cache tables in the anchored table set for heterogeneous cycles between tables; and
modifying referential cache constraints between cache tables when a heterogeneous cycle exists between cache tables, wherein
the determining of addable referential cache constraints, the determining of costs for each addable referential cache constraint, the adding of the referential cache constraint, the checking of the cache tables in the anchored table set, and the modifying of the referential cache constraints is repeated until all possible addable referential cache constraints have been exhausted.

### Claim 7 (depends on 6)

The method of claim 6, further comprising determining a referential cache constraint having a minimal cost amongst each addable referential cache constraint.

### Claim 8 (depends on 7)

The method of claim 7, further comprising calculating a cost for a reverse of each addable referential cache constraint.

### Claim 9 (depends on 8)

The method of claim 8, further comprising calculating a switching cost for each addable referential cache constraint and its corresponding cost for the reverse of each addable referential cache constraint by subtracting the cost of each addable referential cache constraint from its corresponding cost for the reverse of each addable referential cache constraint.

### Claim 10 (depends on 9)

The method of claim 9, wherein the switching cost for each addable referential cache constraint is added to a priority list where the smaller switching costs have higher priority.

### Claim 11

A non-transitory computer-readable storage medium having computer readable code embodied therein and capable of being stored in a memory as computer program instructions that, when executed by a computer having one or more processors, causes the computer to at least perform:
creating an anchored table set configured to hold one or more cache tables;
collecting value-based predicates in a database query;
creating a cache table for each value-based predicate and marking a filling column in each respective cache table;
adding each cache table to the anchored table set;
determining addable referential cache constraints between each cache table in the anchored table set;
determining costs for each addable referential cache constraint;
adding the referential cache constraint based on the determined cost of the respective referential cache constraint;
checking the cache tables in the anchored table set for heterogeneous cycles between tables; and
modifying referential cache constraints between cache tables when a heterogeneous cycle exists between cache tables, wherein
the determining of addable referential cache constraints, the determining of costs for each addable referential cache constraint, the adding of the referential cache constraint, the checking of the cache tables in the anchored table set, and the modifying of the referential cache constraints is repeated until all possible addable referential cache constraints have been exhausted.

### Claim 12 (depends on 11)

The non-transitory computer readable storage medium of claim 11, further comprising determining a referential cache constraint having a minimal cost amongst each addable referential cache constraint.

### Claim 13 (depends on 12)

The non-transitory computer readable storage medium of claim 12, further comprising calculating a cost for a reverse of each addable referential cache constraint.

### Claim 14 (depends on 13)

The non-transitory computer readable storage medium of claim 13, further comprising calculating a switching cost for each addable referential cache constraint and its corresponding cost for the reverse of each addable referential cache constraint by subtracting the cost of each addable referential cache constraint from its corresponding cost for the reverse of each addable referential cache constraint.

### Claim 15 (depends on 14)

The non-transitory computer readable storage medium of claim 14, wherein the switching cost for each addable referential cache constraint is added to a priority list where the smaller switching costs have higher priority.

### Claim 16

A database system, comprising:
a backend database having a memory and one or more processors and storing backend data; and
one or more cache instances having a memory and one or more processors and operatively communicating with the backend database, the one or more processors being configured to:
create an anchored table set configured to hold one or more cache tables;
collect value-based predicates in a database query;
create a cache table for each value-based predicate and marking a filling column in each respective cache table;
add each cache table to the anchored table set;
determine addable referential cache constraints between each cache table in the anchored table set;
determine costs for each addable referential cache constraint;
add the referential cache constraint based on the determined cost of the respective referential cache constraint;
check the cache tables in the anchored table set for heterogeneous cycles between tables; and
modify referential cache constraints between cache tables when a heterogeneous cycle exists between cache tables, wherein
the determining of addable referential cache constraints, the determining of costs for each addable referential cache constraint, the adding of the referential cache constraint, the checking of the cache tables in the anchored table set, and the modifying of the referential cache constraints is repeated until all possible addable referential cache constraints have been exhausted.

### Claim 17 (depends on 16)

The database system of claim 16, wherein the one or more processors in the one or more cache instances are further configured to determine a referential cache constraint having a minimal cost amongst each addable referential cache constraint.

### Claim 18 (depends on 17)

The database system of claim 17, wherein the one or more processors in the one or more cache instances are further configured to calculate a cost for a reverse of each addable referential cache constraint.

### Claim 19 (depends on 18)

The database system of claim 18, wherein the one or more processors in the one or more cache instances are further configured to calculate a switching cost for each addable referential cache constraint and its corresponding cost for the reverse of each addable referential cache constraint by subtracting the cost of each addable referential cache constraint from its corresponding cost for the reverse of each addable referential cache constraint.

### Claim 20 (depends on 19)

The database system of claim 19, wherein the switching cost for each addable referential cache constraint is added to a priority list where the smaller switching costs have higher priority.
