# US 2018/0025065 A1 · Efficient query processing using histograms in a columnar database

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

- Number: US 2018/0025065 A1
- Document ID: US20180025065A1
- Status: Published application
- Kind: A1
- Application number: 15/706,511
- Filed: 2017-09-15
- Published: 2018-01-25
- Earliest claimed: 2013-01-15
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: ANURAG WINDLASS GUPTA
- Web page: https://patentgrep.com/patent/US20180025065A1

## CPC

- G06F 16/254: {Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2237: {Vectors, bitmaps or matrices}
- G06F 16/245: Query processing
- G06F 16/24554: {Unary operations; Data partitioning operations}
- G06F 16/278: {Data partitioning, e.g. horizontal or vertical partitioning}
- 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

A probabilistic data structure is generated for efficient query processing using a histogram for unsorted data in a column of a columnar database. A bucket range size is determined for multiples buckets of a histogram of a column in a columnar database table. In at least some embodiments, the histogram may be a height-balanced histogram. A probabilistic data structure is generated to indicate for which particular buckets in the histogram there is a data value stored in the data block. When an indication of a query directed to the column for select data is received, the probabilistic data structure for each of the data blocks storing data for the column may be examined to determine particular ones of the data blocks which do not need to be read in order to service the query for the select data.

## Claims

### Claim at position 1

-23. (canceled)

### Claim 24

A system, comprising:
one or more hardware processors and memory with program instructions to:
determine a bucket range size for each of a plurality of buckets for a histogram of a column of a columnar database table, wherein each bucket of the plurality of buckets represents an existence of one or more data values of the data in the column within a range of values according to the determined bucket range size;
generate a probabilistic data structure for each of one or more data blocks storing data for the column of the columnar database table, wherein the probabilistic data structure indicates for which particular buckets of the plurality of buckets in the histogram there is a data value stored in the data block; and
examine the probabilistic data structure, responsive to a query, for each of the one or more data blocks storing data for the column to determine ones of the one or more data blocks which do not need to be read in order to service the query.

### Claim 25 (depends on 24)

The system of claim 24, wherein to determine the plurality of bucket range sizes for the histogram of the column of the columnar database table, the program instructions are executable to:
obtain the data of the column;
generate the plurality of buckets; and
set a bucket range size of the plurality of bucket range sizes for each bucket for the histogram such that the data of the column is evenly distributed among the buckets.

### Claim 26 (depends on 24)

The system of claim 24, wherein the probabilistic data structure is a bitmap comprising a plurality of bits, wherein each bit of the bitmap represents each bucket of the plurality of buckets for the histogram, and for every data value included in the bucket range size stored in the data block the bit of the bitmap corresponding to the bucket is set.

### Claim 27 (depends on 24)

The system of claim 24, wherein the program instructions are executable to store the probabilistic data structure of each of the one or more data blocks in a respective entry in a block metadata structure that stores information about the one or more data blocks.

### Claim 28 (depends on 24)

The system of claim 24, further comprising at least one compute node as a leader node of a distributed data warehouse cluster.

### Claim 29 (depends on 24)

The system of claim 24, wherein the histogram of the column of the columnar database table is a height-balanced histogram.

### Claim 30 (depends on 29)

The system of claim 29, the program instructions are executable to:
detect a rebalancing event for the distribution of data in the column among the plurality of buckets;
in response to detecting the rebalancing event:
modify the bucket range size for each of the plurality of buckets for the height-balanced histogram of the column; and
update each probabilistic data structure for each of the one or more data blocks according to the modified bucket range size of the plurality of buckets.

### Claim 31

A method, comprising:
determining a bucket range size for each of a plurality of buckets for a histogram of a column of a columnar database table, wherein each bucket of the plurality of buckets represents an existence of one or more data values of the data in the column within a range of values according to the determined bucket range size;
generating a probabilistic data structure for each of one or more data blocks storing data for the column of the columnar database table, wherein the probabilistic data structure indicates for which particular buckets of the plurality of buckets in the histogram there is a data value stored in the data block; and
examining the probabilistic data structure, responsive to a query, for each of the one or more data blocks storing data for the column to determine ones of the one or more data blocks which do not need to be read in order to service the query.

### Claim 32 (depends on 31)

The method of claim 31, wherein said determining a bucket range size for each of a plurality of buckets for the histogram of the column of the columnar database table comprises:
obtaining the data of the column;
generating the plurality of buckets; and
setting a bucket range size of the plurality of bucket range sizes for each bucket such that the data of the column is evenly distributed among the buckets.

### Claim 33 (depends on 31)

The method of claim 31, wherein said generating the probabilistic data structure for each of the one or more data blocks storing data for the column of the columnar database table comprises:
generating a bitmap for the data block comprising a plurality of bits, wherein each bit represents a different bucket of the plurality of buckets for the histogram; and
setting the respective bit in the bitmap for each of the particular buckets for which there is the data value stored in the data block.

### Claim 34 (depends on 33)

The method of claim 33, further comprising storing the probabilistic data structure of each of the one or more data blocks in a respective entry in a block metadata structure that stores information about the one or more data blocks.

### Claim 35 (depends on 34)

The method of claim 34, wherein said examining the probabilistic data structure for each of the one or more data blocks storing data for the column to determine the particular ones of the one or more data blocks which do not need to be read in order to service the query for the select data comprises:
determining one or more bits representing the one or more buckets within the range of values including the select data; and
examining the one or more bits in each bitmap stored in the block metadata structure for the one or more data blocks to identify those data blocks without one of the one or more bits set as the particular ones which do not need to be read in order to service the query for the select data.

### Claim 36 (depends on 31)

The method of claim 31, wherein the histogram of the column of the columnar database table is a height-balanced histogram.

### Claim 37 (depends on 36)

The method of claim 36, further comprising:
detecting a rebalancing event for the distribution of data in the column among the plurality of buckets;
in response to detecting the rebalancing event:
modifying the bucket range size for each of the plurality of buckets for the height-balanced histogram of the column; and
updating each probabilistic data structure for each of the one or more data blocks according to the modified bucket range size of the plurality of buckets.

### Claim 38

A non-transitory, computer-readable storage medium, storing program instructions that when executed by one or more computing devices implement:
determining a bucket range size for each of a plurality of buckets for a histogram of a column of a columnar database table, wherein each bucket of the plurality of buckets represents an existence of one or more data values of the data in the column within a range of values according to the determined bucket range size;
generating a probabilistic data structure for each of one or more data blocks storing data for the column of the columnar database table, wherein the probabilistic data structure indicates for which particular buckets of the plurality of buckets in the histogram there is a data value stored in the data block; and
examining the probabilistic data structure, responsive to a query, for each of the one or more data blocks storing data for the column to determine ones of the one or more data blocks which do not need to be read in order to service the query

### Claim 39 (depends on 38)

The non-transitory, computer-readable storage medium of claim 38, wherein the program instructions when further executed by the one or more computing devices implement:
obtaining the data of the column;
generating the plurality of buckets; and
setting a bucket range size of the plurality of bucket range sizes for each bucket such that the data of the column is evenly distributed among the buckets.

### Claim 40 (depends on 38)

The non-transitory, computer-readable storage medium of claim 38, wherein the probabilistic data structure is a bitmap comprising a plurality of bits, wherein each bit of the bitmap represents each bucket of the plurality of buckets for the height-balanced histogram, and for every data value included in the bucket range size stored in the data block the bit of the bitmap corresponding to the bucket is set.

### Claim 41 (depends on 38)

The non-transitory, computer-readable storage medium of claim 38, wherein the height-balanced histogram generator is further configured to store the probabilistic data structure of each of the one or more data blocks in a respective entry in a block metadata structure that stores information about the one or more data blocks.

### Claim 42 (depends on 38)

The non-transitory, computer-readable storage medium of claim 38, wherein the program instructions when further executed by the one or more computing devices implement a leader node of a distributed data warehouse cluster.

### Claim 43 (depends on 38)

The non-transitory, computer-readable storage medium of claim 38, wherein the histogram for the column of the columnar database table is a height-balanced histogram, and wherein the program instructions when further executed by the one or more computing devices implement:
detecting a rebalancing event for the distribution of data in the column among the plurality of buckets;
in response to detecting the rebalancing event:
modifying the bucket range size for each of the plurality of buckets for the height-balanced histogram of the column; and
updating each probabilistic data structure for each of the one or more data blocks according to the modified bucket range size of the plurality of buckets.
