# US 2023/0141462 A1 · Scheduling of query pipeline execution

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

- Number: US 2023/0141462 A1
- Document ID: US20230141462A1
- Status: Published application
- Kind: A1
- Application number: 17/674,313
- Filed: 2022-02-17
- Published: 2023-05-11
- Earliest claimed: 2021-11-08
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Florian WOLF; Lukas LANDGRAF; Alexander BOEHM
- Web page: https://patentgrep.com/patent/US20230141462A1

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/24544: {Join order optimisation}
- G06F 11/3409: {for performance assessment}
- G06F 16/2255: {Hash tables}
- G06F 16/24528: {Standardisation; Simplification}
- G06F 16/24539: {using cached or materialised query results}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system includes reception of a query execution plan associated with a plurality of query execution pipelines, estimated execution costs and estimated intermediate result cardinalities, determination of one or more precedence relationships of the plurality of query execution pipelines, determination of an execution order of the plurality of query execution pipelines based on the estimated execution costs, the estimated intermediate result cardinalities, and the one or more precedence relationships, and providing of the execution order of the plurality of query execution pipelines and the query execution plan to a query execution engine.

## Claims

### Claim 1

A system comprising:
a memory storing processor-executable program code; and
a processing unit to execute the processor-executable program code in order to cause the system to:
receive a query execution plan associated with a plurality of query execution pipelines, estimated execution costs and estimated intermediate result cardinalities;
determine one or more precedence relationships of the plurality of query execution pipelines;
determine an execution order of the plurality of query execution pipelines based on the estimated execution costs, the estimated intermediate result cardinalities, and the one or more precedence relationships; and
provide the execution order of the plurality of query execution pipelines and the query execution plan to a query execution engine.

### Claim 2 (depends on 1)

A system according to claim 1, wherein determination of the execution order comprises:
determination of a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determination of a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities; and
determination of the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 3 (depends on 2)

A system according to claim 2, wherein determination of the execution order from the plurality of execution orders comprises determination of one of the plurality of execution orders having a lowest memory cost.

### Claim 4 (depends on 2)

A system according to claim 2, wherein determination of the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determination of one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.

### Claim 5 (depends on 1)

A system according to claim 1, wherein determination of the execution order comprises:
determination, for each of the plurality of query execution pipelines and based on the one or more precedence relationships, of a longest pipeline path to which the query execution pipeline belongs; and
determination of the execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs.

### Claim 6 (depends on 5)

A system according to claim 5, wherein determination of the execution order comprises:
determination of a first execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs;
determination of a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determination of a memory cost of the first execution order based on the estimated execution costs and the estimated intermediate result cardinalities;
determination of a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities, wherein determination of a memory cost of one of the plurality of execution orders terminates if the memory cost of the one of the plurality of execution orders will exceed the memory cost of the first execution order; and
determination of the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 7 (depends on 6)

A system according to claim 6, wherein determination of the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determination of one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.

### Claim 8

A computer-implemented method comprising:
receiving a query execution plan associated with a plurality of query execution pipelines, estimated execution costs and estimated intermediate result cardinalities;
determining one or more precedence relationships of the plurality of query execution pipelines;
determining an execution order of the plurality of query execution pipelines based on the estimated execution costs, the estimated intermediate result cardinalities, and the one or more precedence relationships; and
providing the execution order of the plurality of query execution pipelines and the query execution plan to a query execution engine.

### Claim 9 (depends on 8)

A method according to claim 8, wherein determining the execution order comprises:
determining a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determining a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities; and
determining the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 10 (depends on 9)

A method according to claim 9, wherein determining the execution order from the plurality of execution orders comprises determining one of the plurality of execution orders having a lowest memory cost.

### Claim 11 (depends on 9)

A method according to claim 9, wherein determining the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determining one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.

### Claim 12 (depends on 8)

A method according to claim 8, wherein determining the execution order comprises:
determining, for each of the plurality of query execution pipelines and based on the one or more precedence relationships, of a longest pipeline path to which the query execution pipeline belongs; and
determining the execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs.

### Claim 13 (depends on 12)

A method according to claim 12, wherein determining the execution order comprises:
determining a first execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs;
determining a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determining a memory cost of the first execution order based on the estimated execution costs and the estimated intermediate result cardinalities;
determining a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities, wherein determination of a memory cost of one of the plurality of execution orders terminates if the memory cost of the one of the plurality of execution orders will exceed the memory cost of the first execution order; and
determining the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 14 (depends on 13)

A method according to claim 13, wherein determining the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determining one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.

### Claim 15

A non-transitory medium storing processor-executable program code, the program code executable by a computing system to cause the computing system to:
receive a query execution plan associated with a plurality of query execution pipelines, estimated execution costs and estimated intermediate result cardinalities;
determine one or more precedence relationships of the plurality of query execution pipelines;
determine an execution order of the plurality of query execution pipelines based on the estimated execution costs, the estimated intermediate result cardinalities, and the one or more precedence relationships; and
provide the execution order of the plurality of query execution pipelines and the query execution plan to a query execution engine.

### Claim 16 (depends on 15)

A medium according to claim 15, wherein determination of the execution order comprises:
determination of a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determination of a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities; and
determination of the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 17 (depends on 15)

A medium according to claim 15, wherein determination of the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determination of one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.

### Claim 18 (depends on 15)

A medium according to claim 15, wherein determination of the execution order comprises:
determination, for each of the plurality of query execution pipelines and based on the one or more precedence relationships, of a longest pipeline path to which the query execution pipeline belongs; and
determination of the execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs.

### Claim 19 (depends on 18)

A medium according to claim 18, wherein determination of the execution order comprises:
determination of a first execution order based on the longest pipeline path to which each of the plurality of query execution pipelines belongs;
determination of a plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships;
determination of a memory cost of the first execution order based on the estimated execution costs and the estimated intermediate result cardinalities;
determination of a memory cost of each of the plurality of execution orders based on the estimated execution costs and the estimated intermediate result cardinalities, wherein determination of a memory cost of one of the plurality of execution orders terminates if the memory cost of the one of the plurality of execution orders will exceed the memory cost of the first execution order; and
determination of the execution order from the plurality of execution orders based on the memory costs of each of the plurality of execution orders.

### Claim 20 (depends on 18)

A medium according to claim 18, wherein determination of the plurality of execution orders of the plurality of query execution pipelines based on the one or more precedence relationships comprises:
determination of one of the plurality of query execution pipelines having a memory cost below a threshold,
wherein the determined plurality of execution orders do not include the one of the plurality of query execution pipelines having a memory cost below a threshold.
