# US 2015/0178305 A1 · Adaptive dictionary compression/decompression for column-store databases

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

- Number: US 2015/0178305 A1
- Document ID: US20150178305A1
- Status: Published application
- Kind: A1
- Application number: 14/139,669
- Filed: 2013-12-23
- Published: 2015-06-25
- Earliest claimed: 2013-12-23
- Assignees: Sap SE
- Inventors: Ingo Mueller; Cornelius Ratsch; Peter Sanders; Franz Faerber
- Web page: https://patentgrep.com/patent/US20150178305A1

## CPC

- G06F 16/17: Details of further file system functions
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Innovations for adaptive compression and decompression for dictionaries of a column-store database can reduce the amount of memory used for columns of the database, allowing a system to keep column data in memory for more columns, while delays for access operations remain acceptable. For example, dictionary compression variants use different compression techniques and implementation options. Some dictionary compression variants provide more aggressive compression (reduced memory consumption) but result in slower run-time performance. Other dictionary compression variants provide less aggressive compression (higher memory consumption) but support faster run-time performance. As another example, a compression manager can automatically select a dictionary compression variant for a given column in a column-store database. For different dictionary compression variants, the compression manager predicts run-time performance and compressed dictionary size, given the values of the column, and selects one of the dictionary compression variants.

## Claims

### Claim 1

One or more tangible computer-readable media storing computer-executable instructions for causing a computing system programmed thereby to perform a method comprising:
selecting one of multiple available dictionary compression variants to apply to a dictionary for a column of a table in a column-store database; and
applying the selected dictionary compression variant to the dictionary.

### Claim 2 (depends on 1)

The one or more computer-readable media of claim 1 wherein the dictionary maps distinct values among values of the column to value identifiers, wherein, for domain encoding that uses the dictionary, the values of the column are replaced with corresponding value identifiers, the corresponding value identifiers being oriented as a column vector, and wherein the column-store database is an in-memory column-store database.

### Claim 3 (depends on 2)

The one or more computer-readable media of claim 2 wherein the dictionary is a string dictionary sorted according to the distinct values for the column.

### Claim 4 (depends on 1)

The one or more computer-readable media of claim 1 wherein the multiple available dictionary compression variants include one or more of:
a first dictionary compression variant that uses Huffman coding or Hu-Tucker coding;
a second dictionary compression variant that uses front coding;
a third dictionary compression variant that uses bit compression;
a fourth dictionary compression variant that uses N-gram compression according to which N-tuples are replaced with x-bit codes, for N greater than or equal to 2;
a fifth dictionary compression variant that uses Re-Pair compression; and
a sixth dictionary compression variant that uses column-wise bit compression.

### Claim 5 (depends on 1)

The one or more computer-readable media of claim 1 wherein the multiple available dictionary compression variants include one or more of:
a first dictionary compression variant that uses an array of string data and an array of pointers to locations in the array of string data, wherein the string data is compressed using one of Hu-Tucker coding, bit compression, N-gram compression or Re-Pair compression;
a second dictionary compression variant that uses an array of fixed-length blocks;
a third dictionary compression variant that uses one or more data structures for front coding; and
a fourth dictionary compression variant that uses one or more data structures for bit-wise column compression.

### Claim 6 (depends on 5)

The one or more computer-readable media of claim 5 wherein, for the third dictionary compression variant:
if inline front coding is used, prefix lengths are interleaved with suffix lengths and string suffixes; and
if block header-based front coding is used, a block header includes the prefix lengths and the suffix lengths, and a block includes the string suffixes.

### Claim 7 (depends on 1)

The one or more computer-readable media of claim 1 wherein the method further comprises:
evaluating at least some of the available dictionary compression variants in terms of compressed dictionary size and run-time performance, wherein the selecting is based at least in part on results of the evaluating.

### Claim 8 (depends on 7)

The one or more computer-readable media of claim 7 wherein the selecting is also based at least in part on a tuning parameter that sets a preference between the compressed dictionary size and the run-time performance.

### Claim 9 (depends on 8)

The one or more computer-readable media of claim 8 wherein the method further comprises:
adjusting the tuning parameter based at least in part on amount of free memory.

### Claim 10 (depends on 1)

The one or more computer-readable media of claim 1 wherein the method further comprises:
evaluating at least some of the available dictionary compression variants using compression models for the respective dictionary compression variants, wherein a given compression model of the compression models predicts size of the compressed dictionary using at least some values of the column, wherein the selecting is based at least in part on results of the evaluating.

### Claim 11 (depends on 10)

The one or more computer-readable media of claim 10 wherein a sampling of the values of the column is used to predict the size of the compressed dictionary for the given compression model.

### Claim 12 (depends on 1)

The one or more computer-readable media of claim 1 wherein the method further comprises:
evaluating at least some of the available dictionary compression variants using characteristics of the respective dictionary compression variants, characteristics of the column and characteristics of the computing system for the database, wherein the selecting is based at least in part on results of the evaluating.

### Claim 13 (depends on 12)

The one or more computer-readable media of claim 12 wherein the characteristics of the dictionary compression variants include, for a given dictionary compression variant of the available dictionary compression variants, a compression model and one or more run time values.

### Claim 14 (depends on 12)

The one or more computer-readable media of claim 12 wherein the characteristics of the column include an expected number of extract operations until a next merge operation, an expected number of locate operations until the next merge operation, a size of a column vector for the column, a merge frequency and values of the column.

### Claim 15 (depends on 12)

The one or more computer-readable media of claim 12 wherein the characteristics of the computing system for the database include an amount of free physical memory and an amount of physical memory currently consumed by the database.

### Claim 16 (depends on 1)

The one or more computer-readable media of claim 1 wherein the selecting is based at least in part on user input that indicates the selected dictionary compression variant.

### Claim 17 (depends on 1)

The one or more computer-readable media of claim 1 wherein the selecting includes:
determining which of the multiple available dictionary compression variants results in smallest compressed dictionary size;
determining which of the multiple available dictionary compression variants results in shortest delays in run-time performance; or
determining which of the multiple available dictionary compression variants results in an acceptable trade-off between compressed dictionary size and delays in run-time performance;
wherein the compressed dictionary size accounts for size of the column and/or the run-time performance accounts for frequency of access, and wherein a scaling parameter controls impact of the frequency of access.

### Claim 18

In a computing system that implements a compression manager, a method comprising:
with the computing system, predicting size of a compressed dictionary for a column of a table in a column-store database according to a compression model for a dictionary compression variant; and
with the computing system, based at least in part on the predicted compressed dictionary size, applying the dictionary compression variant to the dictionary.

### Claim 19 (depends on 18)

The method of claim 18 wherein the predicting the size of the compressed dictionary includes sampling values of the column, wherein a subset of the values of the column is used to predict the size of the compressed dictionary.

### Claim 20

A computing system comprising:
an in-memory column-store database adapted to store one or more tables;
a compression manager adapted to compress at least some columns of the one or more tables using domain encoding, wherein the compression manager is further adapted to:
evaluate multiple available dictionary compression variants for a string dictionary for a given column of the at least some columns;
select one of the multiple available dictionary compression variants to apply to the string dictionary for the given column; and
apply the selected dictionary compression variant to the string dictionary.
