# US 10,372,707 B2 · Query execution pipelining with pump operators

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

- Number: US 10,372,707 B2
- Document ID: US10372707B2
- Status: Granted
- Kind: B2
- Application number: 15/363,545
- Filed: 2016-11-29
- Published: 2018-05-31
- Granted: 2019-08-06
- Earliest claimed: 2016-11-29
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Paul Willems; Oliver Horn
- Web page: https://patentgrep.com/patent/US10372707B2

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/24539: {using cached or materialised query results}
- G06F 16/24549: {Run-time optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for query execution and planning with pipelining and pump operators is provided. In some implementations, the system performs operations comprising identifying a plurality of operators for executing a query, the plurality of operators including a first operator and a second operator, generating a pump operator when the first operator comprises a table scan operator, and/or generating a query plan for execution of the query, the query plan comprising the pump operator and the second operator. The operations can further include executing the pump operator to at least retrieve a portion of a database table, generate a first data portion based on the portion of the database table, and provide the first data portion for the second operator. Related systems, methods, and articles of manufacture are also described.

## Claims

### Claim 1

A system comprising:
at least one data processor; and
at least one memory storing instructions which, when executed by the at least one data processor, result in operations comprising:
identifying, by a database execution engine, a plurality of operators for executing a query, the plurality of operators including a first operator and a second operator;
generating, by the database execution engine, a pump operator when the first operator comprises a table scan operator;
generating, by the database execution engine, a query plan for execution of the query, the query plan comprising the pump operator and the second operator; and
executing, by the database execution engine, the pump operator to at least retrieve a portion of a database table, generate a first data portion based on the portion of the database table, and provide the first data portion for the second operator.

### Claim 2 (depends on 1)

The system of claim 1, wherein the table scan operator comprises a plurality of predicate conditions for retrieving the portion of the database table, and wherein the pump operator is executed to additionally select, at runtime, an execution order of the plurality of predicate conditions.

### Claim 3 (depends on 2)

The system of claim 2, wherein the pump operator is generated to include, as a first child node, the plurality of predicate conditions in a hierarchical tree, and wherein the pump operator is generated to include, as a second child node, a push operator for providing the first data portion for the second operator.

### Claim 4 (depends on 1)

The system of claim 1, wherein the first operator is included at a start of a query execution pipeline and the second operator is included in the query execution pipeline and after the first operator.

### Claim 5 (depends on 1)

The system of claim 1, wherein at least a portion of the plurality of operators are split among a plurality of pipelines including a first pipeline and a second pipeline, wherein the plurality of pipelines are executed in a determined order to generate results responsive to the query, and wherein executing the first pipeline comprises iteratively generating one or more blocks of data based upon operations contained within the first pipeline and storing the one or more blocks as intermediate results for the second pipeline.

### Claim 6 (depends on 1)

The system of claim 1, wherein the pump operator is generated based on a coded class definition, and wherein the coded class definition comprises code for implementing at least: a first pull operation, a first push operation, a second pull operation, and a second push operation.

### Claim 7 (depends on 1)

The system of claim 1, wherein the operations further comprise:
storing the first data portion in a predetermined memory location, wherein providing the stored first data portion for the second operator comprises providing access to the predetermined memory location.

### Claim 8 (depends on 7)

The system of claim 7, wherein the first data is removed from the predetermined memory location after it is consumed by the second operator.

### Claim 9 (depends on 1)

The system of claim 1, wherein the first data portion comprises a data table having one or more rows and one or more columns.

### Claim 10 (depends on 1)

The system of claim 1, wherein the database execution engine is configured to provide query optimization of the query plan and select other execution engines to handle certain queries.

### Claim 11

A method comprising:
identifying, by a database execution engine, a plurality of operators for executing a query, the plurality of operators including a first operator and a second operator;
generating, by the database execution engine, a pump operator when the first operator comprises a table scan operator;
generating, by the database execution engine, a query plan for execution of the query, the query plan comprising the pump operator and the second operator; and
executing, by the database execution engine, the pump operator to at least retrieve a portion of a database table, generate a first data portion based on the portion of the database table, and provide the first data portion for the second operator.

### Claim 12 (depends on 11)

The method of claim 11, wherein the table scan operator comprises a plurality of predicate conditions for retrieving the portion of the database table, and wherein the pump operator is executed to additionally select, at runtime, an execution order of the plurality of predicate conditions.

### Claim 13 (depends on 11)

The method of claim 11, wherein the first operator is included at a start of a query execution pipeline and the second operator is included in the query execution pipeline and after the first operator.

### Claim 14 (depends on 11)

The method of claim 11, wherein at least a portion of the plurality of operators are split among a plurality of pipelines including a first pipeline and a second pipeline, wherein the plurality of pipelines are executed in a determined order to generate results responsive to the query, and wherein executing the first pipeline comprises iteratively generating one or more blocks of data based upon operations contained within the first pipeline and storing the one or more blocks as intermediate results for the second pipeline.

### Claim 15 (depends on 11)

The method of claim 11, wherein the pump operator is generated based on a coded class definition, wherein the coded class definition comprises code for sequentially implementing at least: a first pull operator, a first push operator, a second pull operator, and a second push operator.

### Claim 16

A non-transitory computer program product storing instructions which, when executed by at least one data processor, causes operations comprising:
identifying, by a database execution engine, a plurality of operators for executing a query, the plurality of operators including a first operator and a second operator;
generating, by the database execution engine, a pump operator when the first operator comprises a table scan operator;
generating, by the database execution engine, a query plan for execution of the query, the query plan comprising the pump operator and the second operator; and
executing, by the database execution engine, the pump operator to at least retrieve a portion of a database table, generate a first data portion based on the portion of the database table, and provide the first data portion for the second operator.

### Claim 17 (depends on 16)

The non-transitory computer program product of claim 16, wherein the table scan operator comprises a plurality of predicate conditions for retrieving the portion of the database table, and wherein the pump operator is executed to additionally select, at runtime, an execution order of the plurality of predicate conditions.

### Claim 18 (depends on 16)

The non-transitory computer program product of claim 16, wherein the first operator is included at a start of a query execution pipeline and the second operator is included in the query execution pipeline and after the first operator.

### Claim 19 (depends on 16)

The non-transitory computer program product of claim 16, wherein at least a portion of the plurality of operators are split among a plurality of pipelines including a first pipeline and a second pipeline, wherein the plurality of pipelines are executed in a determined order to generate results responsive to the query, and wherein executing the first pipeline comprises iteratively generating one or more blocks of data based upon operations contained within the first pipeline and storing the one or more blocks as intermediate results for the second pipeline.

### Claim 20 (depends on 16)

The non-transitory computer program product of claim 16, wherein the pump operator is generated based on a coded class definition, wherein the coded class definition comprises code for sequentially implementing at least: a first pull operator, a first push operator, a second pull operator, and a second push operator.
