# US 11,907,250 B2 · Workload-aware data encoding

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

- Number: US 11,907,250 B2
- Document ID: US11907250B2
- Status: Granted
- Kind: B2
- Application number: 17/871,092
- Filed: 2022-07-22
- Published: 2024-01-25
- Granted: 2024-02-20
- Earliest claimed: 2022-07-22
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Urvashi Oswal; Marc Jolles; Onur Kocberber; Seema Sundara; Nipun Agarwal
- Web page: https://patentgrep.com/patent/US11907250B2

## CPC

- G06F 16/24561: {Intermediate data storage techniques for performance improvement}
- G06F 16/258: {Data format conversion from or to a database}
- G06F 11/3409: {for performance assessment}
- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/24549: {Run-time optimisation}
- G06F 16/2462: {Approximate or statistical queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are described for executing machine learning models trained for specific operators with feature values that are based on the actual execution of a workload set. The machine learning models generate an estimate of benefit gain/cost for executing operations on data portions in the alternative encoding format. Such data potions may be sorted based on the estimated benefit, in an embodiment. Using cost estimation machine learning models for memory space, the data portions with the most benefits that comply with the existing memory space constraints are recommended and/or are automatically encoded into the alternative encoding format.

## Claims

### Claim 1

A computer-implemented method comprising:
executing, by a database management system (DBMS), a workload set of queries, the workload set of queries referencing a plurality of data portions, on which a plurality of operations of the workload set are performed to generate output for the workload set of queries, the executing the workload set comprising:
performing a first operation, of a first operator from the plurality of operations, on a first data portion, of the plurality of data portions, in a current encoding format;
collecting first operation execution statistics by recording measurements from the performing of the first operation on the first data portion in the current encoding format;
based on the first operation execution statistics, obtaining one or more first feature values of a first plurality of feature values for a machine learning model of the first operator;
executing the machine learning model of the first operator with the one or more first feature values as input to the machine learning model of the first operator;
based on the executing the machine learning model of the first operator, generating a first estimate of benefit amount in performing the first operation on the first data portion in an alternative encoding format, different from the current encoding format, over the performing the first operation on the first data portion in the current encoding format.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
collecting second operation execution statistics by recording measurements from performing of a second operation, of a second operator from the plurality of operations, on the first data portion in the current encoding format;
based on the second operation execution statistics, obtaining one or more second feature values of a second plurality of feature values for a machine learning model of the second operator;
executing the machine learning model of the second operator with the one or more second feature values as input to the machine learning model of the second operator;
based on the executing the machine learning model of the second operator, generating a second estimate of benefit amount in performing the second operation on the first data portion in the alternative encoding format, different from the current encoding format, over the performing the second operation on the first data portion in the current encoding format
aggregating the first estimate of benefit amount for the first data portion with the second estimate of benefit amount for the first data portion to determine aggregate estimate benefit amount for the first data portion in the alternative encoding format.

### Claim 3 (depends on 2)

The method of claim 2, further comprising, based on the aggregate estimate benefit amount for the first data portion, determining whether to encode the first data portion in the alternative encoding format or to continue using the first data portion in the current encoding format.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
based on executing a machine learning model of a second operator, generating a second estimate of benefit amount in performing a second operation with the second operator on a second data portion in the alternative encoding format, different from the current encoding format of the second data portion, over the performing the second operation on the second data portion in the current encoding format;
determining a first estimate memory space cost for encoding the first data portion in the alternative encoding format by executing a memory machine learning model based on data statistics for the first data portion;
determining a second estimate memory space cost for encoding the second data portion in the alternative encoding format by executing the memory machine learning model based on data statistics for the second data portion;
based on the first estimate of benefit amount, the second estimate of benefit amount, the first estimate memory space cost and the second estimate memory space cost, determining whether the first data portion or the second data portion or both are to be encoded in the alternative encoding format.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
based on executing a plurality of machine learning models for different operators that includes the machine learning model of the first operator, generating a plurality of estimates of benefit amounts, each estimate in the plurality of estimates corresponding to a respective data portion in the plurality of data portions of the workload set;
based on the plurality of estimates of benefit amounts, determining which one or more data portions from the plurality of data portions of the workload set are to be encoded in the alternative encoding format to speed the execution of the workload set.

### Claim 6 (depends on 1)

The method of claim 1, wherein the one or more first feature values include one or more of: an actual number of entries processed, an actual number of entries returned, an actual maximum entry width processed, or an actual maximum entry width returned of the first data portion in the first operation.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
obtaining one or more second feature values of the first plurality of feature values for the machine learning model of the first operator;
wherein the one or more second feature values are based on data statistics of the first data portion.

### Claim 8 (depends on 7)

The method of claim 7, wherein the one or more second feature values include one or more of: a number of distinct values, an average entry length, cardinality, or a collation type of the first data portion.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
obtaining one or more second feature values of the first plurality of feature values for the machine learning model of the first operator;
wherein the one or more second feature values are based on pre-execution statistics of the first data portion.

### Claim 10 (depends on 9)

The method of claim 9, wherein the one or more second feature values include one or more of: an estimated number of entries processed, or an estimated number of entries returned of the first data portion in the first operation.

### Claim 11

One or more non-transitory computer-readable media storing a set of instructions, wherein the set of instructions includes instructions, which when executed by one or more hardware processors, cause:
executing, by a database management system (DBMS), a workload set of queries, the workload set of queries referencing a plurality of data portions, on which a plurality of operations of the workload set are performed to generate output for the workload set of queries, the executing the workload set comprising:
performing a first operation, of a first operator from the plurality of operations, on a first data portion, of the plurality of data portions, in a current encoding format;
collecting first operation execution statistics by recording measurements from the performing of the first operation on the first data portion in the current encoding format;
based on the first operation execution statistics, obtaining one or more first feature values of a first plurality of feature values for a machine learning model of the first operator;
executing the machine learning model of the first operator with the one or more first feature values as input to the machine learning model of the first operator;
based on the executing the machine learning model of the first operator, generating a first estimate of benefit amount in performing the first operation on the first data portion in an alternative encoding format, different from the current encoding format, over the performing the first operation on the first data portion in the current encoding format.

### Claim 12 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause:
collecting second operation execution statistics by recording measurements from performing a second operation, of a second operator from the plurality of operations, on the first data portion in the current encoding format;
based on the second operation execution statistics, obtaining one or more second feature values of a second plurality of feature values for a machine learning model of the second operator;
executing the machine learning model of the second operator with the one or more second feature values as input to the machine learning model of the second operator;
based on the executing the machine learning model of the second operator, generating a second estimate of benefit amount in performing the second operation on the first data portion in the alternative encoding format, different from the current encoding format, over the performing the second operation on the first data portion in the current encoding format
aggregating the first estimate of benefit amount for the first data portion with the second estimate of benefit amount for the first data portion to determine aggregate estimate benefit amount for the first data portion in the alternative encoding format.

### Claim 13 (depends on 12)

The one or more non-transitory computer-readable media of claim 12, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause, based on the aggregate estimate benefit amount for the first data portion, determining whether to encode the first data portion in the alternative encoding format or to continue using the first data portion in the current encoding format.

### Claim 14 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause:
based on executing a machine learning model of a second operator, generating a second estimate of benefit amount in performing a second operation with the second operator on a second data portion in the alternative encoding format, different from the current encoding format of the second data portion, over the performing the second operation on the second data portion in the current encoding format;
determining a first estimate memory space cost for encoding the first data portion in the alternative encoding format by executing a memory machine learning model based on data statistics for the first data portion;
determining a second estimate memory space cost for encoding the second data portion in the alternative encoding format by executing the memory machine learning model based on data statistics for the second data portion;
based on the first estimate of benefit amount, the second estimate of benefit amount, the first estimate memory space cost and the second estimate memory space cost, determining whether the first data portion or the second data portion or both are to be encoded in the alternative encoding format.

### Claim 15 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause:
based on executing a plurality of machine learning models for different operators that includes the machine learning model of the first operator, generating a plurality of estimates of benefit amounts, each estimate in the plurality of estimates corresponding to a respective data portion in the plurality of data portions of the workload set;
based on the plurality of estimates of benefit amounts, determining which one or more data portions from the plurality of data portions of the workload set are to be encoded in the alternative encoding format to speed the execution of the workload set.

### Claim 16 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the one or more first feature values include one or more of: an actual number of entries processed, an actual number of entries returned, an actual maximum entry width processed, or an actual maximum entry width returned of the first data portion in the first operation.

### Claim 17 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause:
obtaining one or more second feature values of the first plurality of feature values for the machine learning model of the first operator;
wherein the one or more second feature values are based on data statistics of the first data portion.

### Claim 18 (depends on 17)

The one or more non-transitory computer-readable media of claim 17, wherein the one or more second feature values include one or more of: a number of distinct values, an average entry length, cardinality, or a collation type of the first data portion.

### Claim 19 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which when executed by said one or more hardware processors, cause:
obtaining one or more second feature values of the first plurality of feature values for the machine learning model of the first operator;
wherein the one or more second feature values are based on pre-execution statistics of the first data portion.

### Claim 20 (depends on 19)

The one or more non-transitory computer-readable media of claim 19, wherein the one or more second feature values include one or more of: an estimated number of entries processed, or an estimated number of entries returned of the first data portion in the first operation.
