# US 2017/0293656 A1 · Projections determination for column-based databases

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

- Number: US 2017/0293656 A1
- Document ID: US20170293656A1
- Status: Published application
- Kind: A1
- Application number: 15/510,610
- Filed: 2014-10-31
- Published: 2017-10-12
- Earliest claimed: 2014-10-31
- Assignees: Hewlett Packard Enterprise Development LP
- Applicants: Hewlett Packard Enterprise Development LP
- Inventors: Satwant KAUR; Larry SCHMIDT
- Web page: https://patentgrep.com/patent/US20170293656A1

## CPC

- G06F 16/24545: {Selectivity estimation or determination}
- G06F 16/2453: Query optimisation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present subject matter relates to determining a set of projections for optimizing query execution on a column-based database. In an example implementation, a plurality of historical queries executed on the column-based database is obtained, and the set of projections is determined based on the plurality of historical queries. The set of projections is determined in a manner such that a total cost of the plurality of historical queries over the set of projections is minimum. The total cost is a sum of a cost of each of the plurality of historical queries. The cost of each historical query is computed based on number of columns in a smallest projection from the set of projections which is used for execution of the respective historical query.

## Claims

### Claim 1

A projection determination system for determining a set of projections for optimizing query execution on a column-based database, wherein each projection in the set of projections projects one or more columns of the column-based database for query execution, the projection determination system comprising:
a processor; and
a projection determinator coupled to the processor to,
obtain a plurality of historical queries executed on the column-based database; and
determine the set of projections based on the plurality of historical queries, wherein a total cost of the plurality of historical queries over the set of projections is minimum, wherein the total cost is a sum of a cost of each of the plurality of historical queries, and wherein the cost of each historical query is computed based on number of columns in a smallest projection from the set of projections which is used for execution of the respective historical query.

### Claim 2 (depends on 1)

The projection determination system as claimed in claim 1, wherein the projection determinator is coupled to the processor to,
create the set of projections by adding a super projection to the set of projections, wherein the super projection projects columns of the column-based database; and
iteratively find and add new projections to update the set of projections, wherein each new projection is a projection that minimizes a total cost of the plurality of historical queries over the updated set of projections for a respective iteration, and wherein the cost of each historical query is computed based on number of columns in a smallest projection from the updated set of projections for the respective iteration, which is used for execution of the respective historical query.

### Claim 3 (depends on 2)

The projection determination system as claimed in claim 2, wherein the new projections are iteratively found and added until the set of projections has a predefined maximum number of projections.

### Claim 4 (depends on 2)

The projection determination system as claimed in claim 2, wherein the new projections are iteratively found and added until the total cost of the plurality of historical queries over the updated set of projections is unchanged for two consecutive iterations.

### Claim 5 (depends on 2)

The projection determination system as claimed in claim 2, wherein the projection determinator is coupled to the processor to, in each iteration,
generate projections that project up to k columns of the column-based database, wherein k is at least two;
select a projection from the generated projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections;
generate modified projections by adding up to k columns of the column-based database to the selected projection;
select a projection from the modified projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections; and
iteratively generate subsequent modified projections by adding up to k columns of the column-based database to the projection selected from the previously modified projections, and select a subsequent projection from the subsequent modified projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections,
wherein the subsequent modified projections are iteratively generated and the subsequent projection is selected until the total cost in an iteration is one of more than and equal to the total cost of the plurality of historical queries over the set of projections in a previous iteration, wherein the projection selected from a last iteration is the new projection to update the set of projections.

### Claim 6 (depends on 1)

The projection determination system as claimed in claim 1, wherein the plurality of historical queries comprises queries executed on the column-based database for a predefined historical time period.

### Claim 7

A method of determining a set of projections for optimizing query execution on a column-based database, wherein each projection in the set of projections projects one or more columns of the column-based database for query execution, the method comprising:
obtaining a plurality of historical queries executed on the column-based database;
creating the set of projections by adding a super projection to the set of projections, wherein the super projection projects columns of the column-based database; and
iteratively finding and adding new projections based on the plurality of historical queries to update the set of projections, wherein each new projection is a projection that minimizes a total cost of the plurality of historical queries over the updated set of projections for a respective iteration, and wherein the total cost is a sum of a cost of each of the plurality of historical queries, and wherein the cost of each historical query is computed based on number of columns in a smallest projection from the updated set of projections for the respective iteration, which is used for execution of the respective historical query.

### Claim 8 (depends on 7)

The method as claimed in claim 7, wherein the iteratively finding and adding the new projections are until the set of projections has a predefined maximum number of projections.

### Claim 9 (depends on 7)

The method as claimed in claim 7, wherein the iteratively finding and adding the new projections are until the total cost of the plurality of historical queries over the updated set of projections is unchanged for two consecutive iterations.

### Claim 10 (depends on 7)

The method as claimed in claim 7, wherein the iteratively finding and adding the new projection, in each iteration, comprises:
generating projections that project up to k columns of the column-based database, wherein k is at least two;
selecting a projection from the generated projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections;
generating modified projections by adding up to k columns of the column-based database to the selected projection;
selecting a projection from the modified projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections; and
iteratively generating subsequent modified projections by adding up to k columns of the column-based database to the projection selected from the previously modified projections, and selecting a subsequent projection from the subsequent modified projections, which, when added to the set of projections, minimizes the total cost of the plurality of historical queries over the set of projections,
wherein the iteratively generating and selecting are until the total cost in an iteration is one of more than and equal to the total cost of the plurality of historical queries over the set of projections in a previous iteration, wherein the projection selected from a last iteration is the new projection to update the set of projections.

### Claim 11 (depends on 7)

The method as claimed in claim 7, wherein the plurality of historical queries comprises queries executed on the column-based database for a predefined historical time period.

### Claim 12

A non-transitory computer-readable medium comprising computer-readable instructions for determining a set of projections for a column-based database, executable by a processing resource of a projection determination system to:
obtain a plurality of historical queries executed on the column-based database; and
determine the set of projections based on the plurality of historical queries, wherein a total run-time of the plurality of historical queries over the set of projections is minimum, wherein the total run-time is a sum of a run-time of each of the plurality of historical queries, and wherein the run-time of each historical query is computed based on number of columns in a smallest projection from the set of projections which is used for execution of the respective historical query.

### Claim 13 (depends on 12)

The non-transitory computer-readable medium as claimed in claim 12 comprising computer-readable instructions executable by the processing resource to:
create the set of projections by adding a super projection to the set of projections, wherein the super projection projects columns of the column-based database; and
iteratively find and add new projections to update the set of projections, wherein each new projection is a projection that minimizes a total run-time of the plurality of historical queries over the updated set of projections for a respective iteration, and wherein the run-time of each historical query is computed based on number of columns in a smallest projection from the updated set of projections for the respective iteration, which is used for execution of the respective historical query.

### Claim 14 (depends on 12)

The non-transitory computer-readable medium as claimed in claim 12 comprising computer-readable instructions executable by the processing resource to iteratively find and add the new projections until the set of projections has a predefined maximum number of projections.

### Claim 15 (depends on 12)

The non-transitory computer-readable medium as claimed in claim 12 comprising computer-readable instructions executable by the processing resource to iteratively find and add the new projections until the total run-time of the plurality of historical queries over the updated set of projections is unchanged for two consecutive iterations.
