# US 2015/0088805 A1 · Automatic caching of scan and random access data in computing systems

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

- Number: US 2015/0088805 A1
- Document ID: US20150088805A1
- Status: Published application
- Kind: A1
- Application number: 14/489,221
- Filed: 2014-09-17
- Published: 2015-03-26
- Earliest claimed: 2013-09-20
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Sarat B. Kakarla; Jia Shi; Selcuk Aya; Kothanda Umamageswaran; Juan R. Loaiza
- Web page: https://patentgrep.com/patent/US20150088805A1

## CPC

- G06F 16/24552: {Database cache management}
- G06F 16/217: {Database tuning (G06F16/2282 takes precedence; database performance monitoring G06F11/3409)}
- G06F 16/283: {Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Approaches, techniques, and mechanisms are disclosed for improved caching in database systems that deal with multiple data access patterns, such as in database systems that interface with both OLTP and Data Warehouse clients. A cache is deployed between a database server and a storage system that stores data units. Some of the data units accessed by the database server are buffered within the cache. The data units may be associated with data access patterns, such as a random data access pattern or a scan data access pattern, in accordance with which the database server is or appears to be accessing the data units. A processor selects when to cache data units accessed by the database server, based at least on the associated data access patterns. Recent access counts may also be stored for the data units, and may further be utilized to select when to cache data units.

## Claims

### Claim 1

A method comprising:
responsive to requests from a database server to access data units stored in one or more storage systems, determining that at least certain data units accessed by the requests are not found in a cache;
associating the certain data units with data access patterns, each unit of the certain data units associated with a particular data access pattern of the data access patterns, the data access patterns including a scan data access pattern and a random data access pattern;
applying one or more caching policies to determine when to cache particular data units of the certain data units, based at least partially on the data access patterns associated with the certain data units;
storing at least one of the particular data units in the cache responsive to the requests, based on the one or more caching policies;
wherein the method is performed by one or more computing devices.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time, the one or more caching policies being based at least partially on the recent access counts.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time, the one or more caching policies being based at least partially on the recent access counts;
adjusting the recent access counts to emphasize data units associated with the random access pattern more heavily than data units associated with the scan access pattern.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time;
wherein applying the one or more caching policies comprises:
determining whether to cache a given data unit associated with the scan data access pattern based on comparing the recent access count of the given data unit to a threshold count;
determining whether to cache given data unit associated with the random access pattern does not comprise comparing the recent access count of the given data unit to the threshold count.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time;
wherein applying the one or more caching policies comprises determining whether to cache a given data unit associated with the scan access data pattern by comparing the recent access count of the given data unit to one or more recent access counts for a set of cached data units already stored in the cache, and comparing a last access time of the given data unit to one or more last access times for the set of cached data units already stored in the cache.

### Claim 6 (depends on 5)

The method of claim 5, further comprising adjusting the recent access counts to emphasize more recent accesses of the data units more heavily than less recent accesses.

### Claim 7 (depends on 1)

The method of claim 1, wherein the scan data access pattern pertains to data accessed for data warehousing operations, and the random data access pattern pertains to data accessed for OLTP operations.

### Claim 8 (depends on 1)

The method of claim 1, wherein the one or more caching policies includes a first policy to always cache any data unit associated with the random data access pattern.

### Claim 9 (depends on 1)

The method of claim 1, wherein applying the one or more caching policies comprises determining in which cache lines, of a plurality of cache lines within the cache, to store a given data unit, based at least in part on which particular data access pattern of the data access patterns is associated with the given data unit.

### Claim 10 (depends on 1)

The method of claim 1,
wherein applying the one or more caching policies to a given data unit associated with the scan data access pattern includes determining to cache the given data unit if a number of cache lines in the cache are determined to be eligible to store the given data unit, the number being of sufficient size to store the given data unit;
wherein determining a cache line to be eligible comprises:
when existing data already stored in the cache line is associated with the scan data access pattern, comparing a recent access count of the existing data to a recent access count of the given data unit; and
when the existing data already stored in the cache line is associated with the random data access pattern, comparing a recent access count of the existing data to a weighted recent access count of the given data unit.

### Claim 11 (depends on 1)

The method of claim 1, wherein applying the one or more caching policies to a given data unit associated with the scan data access pattern further includes determining to cache the given data unit only if doing so will not result in the cache being comprised of more than a threshold percentage of data associated with the scan data access pattern.

### Claim 12

The method of 1, further comprising associating a given data unit of the certain data units with a given data access pattern of the data access patterns based on one or more of: an access pattern indicator in metadata associated with a most recent request in which the given data unit is involved, a characteristic of the most recent request, or a characteristic of the given data unit.

### Claim 13

One or more non-transitory computer-readable media storing instructions that, when executed by the one or more computing devices, cause performance of:
responsive to requests from a database server to access data units stored in one or more storage systems, determining that at least certain data units accessed by the requests are not found in a cache;
associating the certain data units with data access patterns, each unit of the certain data units associated with a particular data access pattern of the data access patterns, the data access patterns including a scan data access pattern and a random data access pattern;
applying one or more caching policies to determine when to cache particular data units of the certain data units, based at least partially on the data access patterns associated with the certain data units;
storing at least one of the particular data units in the cache responsive to the requests, based on the one or more caching policies.

### Claim 14 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the instructions, when executed by the one or more computing devices, further cause performance of:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time, the one or more caching policies being based at least partially on the recent access counts.

### Claim 15 (depends on 1)

The method of claim 1, further comprising:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time, the one or more caching policies being based at least partially on the recent access counts;
adjusting the recent access counts to emphasize data units associated with the random access pattern more heavily than data units associated with the scan access pattern.

### Claim 16 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the instructions, when executed by the one or more computing devices, further cause performance of:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time;
wherein applying the one or more caching policies comprises:
determining whether to cache a given data unit associated with the scan data access pattern based on comparing the recent access count of the given data unit to a threshold count;
determining whether to cache given data unit associated with the random access pattern does not comprise comparing the recent access count of the given data unit to the threshold count.

### Claim 17 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the instructions, when executed by the one or more computing devices, further cause performance of:
tracking recent access counts for the data units stored in the one or more storage systems, the recent access counts being based in part on how frequently the data units have been accessed over a recent period of time;
wherein applying the one or more caching policies comprises:
determining whether to cache a given data unit associated with the scan access data pattern by comparing the recent access count of the given data unit to one or more recent access counts for a set of cached data units already stored in the cache, and comparing a last access time of the given data unit to one or more last access times for the set of cached data units already stored in the cache.

### Claim 18 (depends on 17)

The one or more non-transitory computer-readable media of claim 17, further comprising adjusting the recent access counts to emphasize more recent accesses of the data units more heavily than less recent accesses.

### Claim 19 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the scan data access pattern pertains to data accessed for data warehousing operations, and the random data access pattern pertains to data accessed for OLTP operations.

### Claim 20 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the one or more caching policies includes a first policy to always cache any data unit associated with the random data access pattern.

### Claim 21 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein applying the one or more caching policies comprises determining in which cache lines, of a plurality of cache lines within the cache, to store a given data unit, based at least in part on which particular data access pattern of the data access patterns is associated with the given data unit.

### Claim 22 (depends on 13)

The one or more non-transitory computer-readable media of claim 13,
wherein applying the one or more caching policies to a given data unit associated with the scan data access pattern includes determining to cache the given data unit if a number of cache lines in the cache are determined to be eligible to store the given data unit, the number being of sufficient size to store the given data unit;
wherein determining a cache line to be eligible comprises:
when existing data already stored in the cache line is associated with the scan data access pattern, comparing a recent access count of the existing data to a recent access count of the given data unit; and
when the existing data already stored in the cache line is associated with the random data access pattern, comparing a recent access count of the existing data to a weighted recent access count of the given data unit.

### Claim 23 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein applying the one or more caching policies to a given data unit associated with the scan data access pattern further includes determining to cache the given data unit only if doing so will not result in the cache being comprised of more than a threshold percentage of data associated with the scan data access pattern.

### Claim 24 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the instructions, when executed by the one or more computing devices, further cause performance of: associating a given data unit of the certain data units with a given data access pattern of the data access patterns based on one or more of: an access pattern indicator in metadata associated with a most recent request in which the given data unit is involved, a characteristic of the most recent request, or a characteristic of the given data unit.

### Claim 25

A computer system comprising:
one or more processors;
one or more interfaces communicably coupled to one or more database servers and one or more storage systems;
one or more storage media configured to store a cache comprising cache lines in which are cached data units, from the one or more storage systems, that were accessed by the database server;
one or more storage media configured to store cache metadata, the cache metadata including at least recent access counts reflecting how frequently the data units have been accessed over a recent period of time;
wherein the one or more processors are configured to:
associate data units with data access patterns in accordance with which the database server is or appears to be accessing the data units; and
select whether to cache data units accessed by the database server, based at least on the associated data access patterns and the recent access counts.

### Claim 26 (depends on 25)

The computer system of claim 25, wherein the one or more processors are further configured to select where to store cacheable data units based at least on the associated data access patterns and the recent access counts.
