# US 2016/0253390 A1 · On-the-fly encoding method for efficient grouping and aggregation

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

- Number: US 2016/0253390 A1
- Document ID: US20160253390A1
- Status: Published application
- Kind: A1
- Application number: 15/150,493
- Filed: 2016-05-10
- Published: 2016-09-01
- Earliest claimed: 2013-06-14
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Gopi K. Attaluri; Ronald J. Barber; Vincent Kulandaisamy; Sam S. Lightstone; Guy M. Lohman; Ippokratis Pandis; Vijayshankar Raman; Richard S. Sidle; Liping Zhang; Naresh Chainani
- Web page: https://patentgrep.com/patent/US20160253390A1

## CPC

- G06F 16/90335: {Query processing}
- G06F 16/2428: {Query predicate definition using graphical user interfaces, including menus and forms (G06F16/2423 takes precedence)}
- G06F 16/2456: {Join operations}
- G06F 16/258: {Data format conversion from or to a database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments include a method, system, and computer program product for encoding data while it is being processed as part of a query is provided. The method includes receiving a query request and determining a set of values associated with data to be encoded for completing the query request. The method also includes encoding those values such that any subsequent processing operations can be performed on the encoded values to complete the requested query. After performing the subsequent processing operations to complete the requested query, each value is decoded back to its original value.

## Claims

### Claim 1

A method for encoding data, the method comprising:
receiving a query;
encoding a group of database values associated with the query to obtain an encoded value;
processing the query, wherein processing the query comprises executing at least one processing operation on the encoded value; and
decoding the encoded value to obtain the group of database values.

### Claim 2 (depends on 1)

The method of claim 1, wherein encoding the group of database values to obtain the encoded value comprises:
performing a first set of one or more database operations on a database table to obtain an encoding table, wherein the encoding table indicates that the encoded value is associated with the group of database values; and
performing a second set of one or more database operations to convert the group of database values to the encoded value.

### Claim 3 (depends on 2)

The method of claim 2, wherein the first set of one or more database operations comprises a group-by operation and the second set of one or more database operations comprises a join operation executed on the database table and the encoding table.

### Claim 4 (depends on 1)

The method of claim 1, wherein the encoded value is a record identifier of a characteristic record of a plurality of records containing the group of database values.

### Claim 5 (depends on 1)

The method claim 1, further comprising executing a function to generate the encoded value, wherein the function is selected from the group consisting of a generate-unique function and a serial number function.

### Claim 6 (depends on 1)

The method of claim 1, wherein decoding the encoded value comprises performing a database operation on a first database table comprising the group of database values and a second database table comprising the encoded value to recapture the group of database values.

### Claim 7 (depends on 1)

The method of claim 1, wherein the group of database values is a second group of database values, the method further comprising:
determining that a predicate of the query excludes one or more values in a first group of database values; and
discarding the one or more values from the first group of database values to obtain the second group of database values such that the encoding is not performed on the one or more values.

### Claim 8

A system for encoding data, the system comprising:
at least one memory storing computer-executable instructions; and
at least one processor configured to access the at least one memory and execute the computer-executable instructions to:
receive a query;
encode a group of database values associated with the query to obtain an encoded value;
process the query, wherein processing the query comprises executing at least one processing operation on the encoded value; and
decode the encoded value to obtain the group of database values.

### Claim 9 (depends on 8)

The system of claim 8, wherein the at least one processor is configured to encode the group of database values to obtain the encoded value by executing the computer-executable instructions to:
perform a first set of one or more database operations on a database table to obtain an encoding table, wherein the encoding table indicates that the encoded value is associated with the group of database values; and
perform a second set of one or more database operations to convert the group of database values to the encoded value.

### Claim 10 (depends on 9)

The system of claim 9, wherein the first set of one or more database operations comprises a group-by operation and the second set of one or more database operations comprises a join operation executed on the database table and the encoding table.

### Claim 11 (depends on 8)

The system of claim 8, wherein the encoded value is a record identifier of a characteristic record of a plurality of records containing the group of database values.

### Claim 12 (depends on 8)

The system of claim 8, wherein the at least one processor is further configured to execute a function to generate the encoded value, wherein the function is selected from the group consisting of a generate-unique function and a serial number function.

### Claim 13 (depends on 8)

The system of claim 8, wherein the at least one processor is configured to decode the encoded value by executing the computer-executable instructions to perform a database operation on a first database table comprising the group of database values and a second database table comprising the encoded value to recapture the group of database values.

### Claim 14 (depends on 8)

The system of claim 8, wherein the group of database values is a second group of database values, and wherein the at least one processor is further configured to execute the computer-executable instructions to:
determine that a predicate of the query excludes one or more values in a first group of database values; and
discard the one or more values from the first group of database values to obtain the second group of database values such that the encoding is not performed on the one or more values.

### Claim 15

A computer program product for encoding data, the computer program product comprising a non-transitory storage medium readable by a processing circuit, the storage medium storing instructions executable by the processing circuit to cause a method to be performed, the method comprising:
receiving a query;
encoding a group of database values associated with the query to obtain an encoded value;
processing the query, wherein processing the query comprises executing at least one processing operation on the encoded value; and
decoding the encoded value to obtain the group of database values.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein encoding the group of database values to obtain the encoded value comprises:
performing a first set of one or more database operations on a database table to obtain an encoding table, wherein the encoding table indicates that the encoded value is associated with the group of database values; and
performing a second set of one or more database operations to convert the group of database values to the encoded value.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the first set of one or more database operations comprises a group-by operation and the second set of one or more database operations comprises a join operation executed on the database table and the encoding table.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein the encoded value is a record identifier of a characteristic record of a plurality of records containing the group of database values.

### Claim 19 (depends on 15)

The computer program product of claim 15, wherein decoding the encoded value comprises performing a database operation on a first database table comprising the group of database values and a second database table comprising the encoded value to recapture the group of database values.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein the group of database values is a second group of database values, the method further comprising:
determining that a predicate of the query excludes one or more values in a first group of database values; and
discarding the one or more values from the first group of database values to obtain the second group of database values such that the encoding is not performed on the one or more values.
