# US 2022/0284005 A1 · Relational method for transforming unsorted sparse dictionary encodings into unsorted-dense or sorted -dense dictionary encodings

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

- Number: US 2022/0284005 A1
- Document ID: US20220284005A1
- Status: Published application
- Kind: A1
- Application number: 17/752,766
- Filed: 2022-05-24
- Published: 2022-09-08
- Earliest claimed: 2018-10-09
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Pit Fender; Felix Schmidt; Benjamin Schlegel
- Web page: https://patentgrep.com/patent/US20220284005A1

## CPC

- G06F 16/2255: {Hash tables}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 7/08: Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry (by merging two or more sets of carriers in ordered sequence G06F7/16)
- G06F 16/212: {with details for data modelling support}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/258: {Data format conversion from or to a database}
- H03M 7/3088: {employing the use of a dictionary, e.g. LZ78}
- H03M 7/42: using table look-up for the coding or decoding process, e.g. using read-only memory {(H03M7/4006 takes precedence)}
- H03M 7/707: {Structured documents, e.g. XML}
- H03M 7/3091: {Data deduplication}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

Unsorted sparse dictionary encodings are transformed into unsorted-dense or sorted-dense dictionary encodings. Sparse domain codes have large gaps between codes that are adjacent in order. Unlike spare codes, dense codes have smaller gaps between adjacent codes; consecutive codes are dense codes that have no gaps between adjacent codes. The techniques described herein are relational approaches that may be used to generate sparse composite codes and sorted codes.

## Claims

### Claim 1

A method of encoding a base table by a multi-node database management system (DBMS), comprising:
from a base table that contains a token column, generating a sparsely-encoded table, wherein said token column contains a plurality of tokens and a plurality of distinct tokens, said plurality of distinct tokens containing a subset of distinct of tokens, each subset of distinct tokens being mutually exclusive;
wherein said sparsely-encoded table contains a plurality of sparse composite codes in a sparse composite code column, each sparse composite code including a local code corresponding to a distinct token of said plurality of tokens and a node identifier identifying a node of said multi-node DBMS;
wherein generating said sparsely-encoded table includes, for each node of said multi-node DBMS, said each node generating said local codes that identify said each node in a local column for rows of said sparsely-encoded table that hold, in said token column, a respective subset of distinct tokens of said each node;
generating an NDV table comprising NDV rows, each NDV row of said NDV rows identifying a respective node of said multi-node DBMS and a corresponding number of distinct values in the respective node;
based on the NDV table, generating an offset table comprising offset rows, each offset row of said offset rows identifying a respective node of said multi-node DBMS and an offset that exclusively covers the number of distinct values corresponding to the respective node of the said each offset row;
generating a sparse-to-dense table based on said offset table, said sparse-to-dense table including a dense code column containing a plurality of dense codes, each dense code of said plurality of dense codes corresponding to a distinct token of said plurality of distinct tokens;
encoding the token column based on the sparse-to-dense table.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating said offset table comprises executing a database statement that causes, for each NDV row of said NDV table, generating the offset of said each NDV row by summing offsets in at least one or more previous rows in said NDV table.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating a sparse-to-dense table comprises executing a database statement that causes:
for each row of said sparse-to-dense table:
joining a particular row from said offset table with a particular row from said sparsely-encoded table, wherein the respective node identified by said particular row from said offset table is identified by the sparse composite code in said particular row from said sparsely-encoded table;
generating a dense code for the dense column of said particular row of said sparse-to-dense table by applying an offset in said particular row from said offset table to the local code specified by the sparse composite code of from the particular row from said sparsely-encode table.

### Claim 4 (depends on 1)

The method of claim 1, wherein generating said sparsely-encoded table includes:
executing a database statement that specifies to generate a plurality of partitions based on said token column of said base table;
each node of said multi-node DBMS generating rows of said sparsely encode table for one or more partitions of said plurality of partitions.

### Claim 5 (depends on 4)

The method of claim 4, wherein said database statement includes a windows functions that specifies said plurality of partition.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
after generating said sparse-to-dense table, generating an encoded base table, wherein generating the encoded base table includes executing a database statement that causes:
equi-join said plurality of sorted codes from said unsorted to sorted table and a plurality of primary keys from said base table.

### Claim 7

One or more non-transitory computer-readable media storing sequences instructions for encoding a base table by a multi-node database management system (DBMS), wherein said sequences of instructions, when executed by one or more processors, cause:
from a base table that contains a token column, generating a sparsely-encoded table, wherein said token column contains a plurality of tokens and a plurality of distinct tokens, said plurality of distinct tokens containing a subset of distinct of tokens, each subset of distinct tokens being mutually exclusive;
wherein said sparsely-encoded table contains a plurality of sparse composite codes in a sparse composite code column, each sparse composite code including a local code corresponding to a distinct token of said plurality of tokens and a node identifier identifying a node of said multi-node DBMS;
wherein generating said sparsely-encoded table includes, for each node of said multi-node DBMS, said each node generating said local codes that identify said each node in a local column for rows of said sparsely-encoded table that hold, in said token column, a respective subset of distinct tokens of said each node;
generating an NDV table comprising NDV rows, each NDV row of said NDV rows identifying a respective node of said multi-node DBMS and a corresponding number of distinct values in the respective node;
based on the NDV table, generating an offset table comprising offset rows, each offset row of said offset rows identifying a respective node of said multi-node DBMS and an offset that exclusively covers the number of distinct values corresponding to the respective node of the said each offset row;
generating a sparse-to-dense table based on said offset table, said sparse-to-dense table including a dense code column containing a plurality of dense codes, each dense code of said plurality of dense codes corresponding to a distinct token of said plurality of distinct tokens;
encoding the token column based on the sparse-to-dense table.

### Claim 8 (depends on 7)

The one or more non-transitory computer-readable media of claim 7, wherein generating said offset table comprises executing a database statement that causes, for each NDV row of said NDV table, generating the offset of said each NDV row by summing offsets in at least one or more previous rows in said NDV table.

### Claim 9 (depends on 8)

The one or more non-transitory computer-readable media of claim 8, wherein generating a sparse-to-dense table comprises executing a database statement that causes:
for each row of said sparse-to-dense table:
joining a particular row from said offset table with a particular row from said sparsely-encoded table, wherein the respective node identified by said particular row from said offset table is identified by the sparse composite code in said particular row from said sparsely-encoded table;
generating a dense code for the dense column of said particular row of said sparse-to-dense table by applying an offset in said particular row from said offset table to the local code specified by the sparse composite code of from the particular row from said sparsely-encode table.

### Claim 10 (depends on 7)

The one or more non-transitory computer-readable media of claim 7, wherein generating said sparsely-encoded table includes:
executing a database statement that specifies to generate a plurality of partitions based on said token column of said base table;
each node of said multi-node DBMS generating rows of said sparsely encode table for one or more partitions of said plurality of partitions.

### Claim 11 (depends on 10)

The one or more non-transitory computer-readable media of claim 10, wherein said database statement includes a windows functions that specifies said plurality of partition.

### Claim 12 (depends on 7)

The one or more non-transitory computer-readable media of claim 7, wherein said sequences of instructions include instructions that, when executed by said one or more processors, cause:
after generating said sparse-to-dense table, generating an encoded base table, wherein generating the encoded base table includes executing a database statement that causes:
equi-join said plurality of sorted codes from said unsorted to sorted table and a plurality of primary keys from said base table.

### Claim 13

A multi-node database management system (DBMS), wherein said DBMS is configured for:
from a base table that contains a token column, generating a sparsely-encoded table, wherein said token column contains a plurality of tokens and a plurality of distinct tokens, said plurality of distinct tokens containing a subset of distinct of tokens, each subset of distinct tokens being mutually exclusive;
wherein said sparsely-encoded table contains a plurality of sparse composite codes in a sparse composite code column, each sparse composite code including a local code corresponding to a distinct token of said plurality of tokens and a node identifier identifying a node of said multi-node DBMS;
wherein generating said sparsely-encoded table includes, for each node of said multi-node DBMS, said each node generating said local codes that identify said each node in a local column for rows of said sparsely-encoded table that hold, in said token column, a respective subset of distinct tokens of said each node;
generating an NDV table comprising NDV rows, each NDV row of said NDV rows identifying a respective node of said multi-node DBMS and a corresponding number of distinct values in the respective node;
based on the NDV table, generating an offset table comprising offset rows, each offset row of said offset rows identifying a respective node of said multi-node DBMS and an offset that exclusively covers the number of distinct values corresponding to the respective node of the said each offset row;
generating a sparse-to-dense table based on said offset table, said sparse-to-dense table including a dense code column containing a plurality of dense codes, each dense code of said plurality of dense codes corresponding to a distinct token of said plurality of distinct tokens;
encoding the token column based on the sparse-to-dense table.

### Claim 14 (depends on 13)

The multi-node database management system DBMS of claim 13, wherein generating said offset table comprises executing a database statement that causes, for each NDV row of said NDV table, generating the offset of said each NDV row by summing offsets in at least one or more previous rows in said NDV table.

### Claim 15 (depends on 14)

The multi-node database management system DBMS of claim 14, wherein generating a sparse-to-dense table comprises executing a database statement that causes:
for each row of said sparse-to-dense table:
joining a particular row from said offset table with a particular row from said sparsely-encoded table, wherein the respective node identified by said particular row from said offset table is identified by the sparse composite code in said particular row from said sparsely-encoded table;
generating a dense code for the dense column of said particular row of said sparse-to-dense table by applying an offset in said particular row from said offset table to the local code specified by the sparse composite code of from the particular row from said sparsely-encode table.

### Claim 16 (depends on 13)

The multi-node database management system DBMS of claim 13, wherein generating said sparsely-encoded table includes:
executing a database statement that specifies to generate a plurality of partitions based on said token column of said base table;
each node of said multi-node DBMS generating rows of said sparsely encode table for one or more partitions of said plurality of partitions.

### Claim 17 (depends on 16)

The multi-node database management system DBMS of claim 16, wherein said database statement includes a windows functions that specifies said plurality of partition.

### Claim 18 (depends on 13)

The multi-node database management system DBMS of claim 13, wherein said sequences of instructions include instructions that, when executed by said one or more processors, cause:
after generating said sparse-to-dense table, generating an encoded base table, wherein generating the encoded base table includes executing a database statement that causes:
equi-join said plurality of sorted codes from said unsorted to sorted table and a plurality of primary keys from said base table.
