# US 11,442,934 B2 · Database calculation engine with dynamic top operator

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

- Number: US 11,442,934 B2
- Document ID: US11442934B2
- Status: Granted
- Kind: B2
- Application number: 16/833,318
- Filed: 2020-03-27
- Published: 2021-09-30
- Granted: 2022-09-13
- Earliest claimed: 2020-03-27
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Michael Ludwig; Johannes Merx; Matthias Vigelius; Christoph Weyerhaeuser
- Web page: https://patentgrep.com/patent/US11442934B2

## CPC

- G06F 16/2453: Query optimisation
- G06F 16/2228: {Indexing structures}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, a system, and a computer program product for executing a query. A query associated with a calculation scenario defining a data flow model that includes one or more calculation nodes is received. Each calculation node corresponds to an operation being performed on one or more database tables stored at a database. The calculation nodes include one or more nodes specifying a window function operation. The window function operation including one or more first attributes and one or more second attributes. A calculation engine executes the calculation scenario by performing, using at least one of the first and second attributes, the window function operation on the database tables stored at the database. Based on the execution of the calculation scenario, a result data set is generated and provided by the database server to the application server.

## Claims

### Claim 1

A computer-implemented method, comprising:
receiving, by a database server from an application server, a query associated with a reusable calculation scenario defining a data flow model that includes one or more calculation nodes, each one or more calculation nodes corresponding to an operation being performed on one or more database tables stored at a database, the one or more calculation nodes including one or more nodes specifying a window function operation, the window function operation including one or more first attributes and one or more second attributes, wherein a portion of the calculation scenario not forming part of the received query being removed during instantiation of the calculation scenario;
executing, by a calculation engine, the calculation scenario, the executing including, using at least one of the first and second attributes, performing the window function operation on the one or more database tables stored at the database, at least one first calculation node in the one or more calculation nodes is executed by the calculation engine, and at least one second calculation node in the one or more calculation nodes is transformed into a set of logical database execution plans having a combination of a plurality of calculation nodes and corresponding operations, wherein each of the first and second attributes being associated with a corresponding rule configured to be triggered upon attributes exceeding a corresponding predetermined threshold, at least one rule being generated based on a determination of at least one of an estimated and an actual amount of memory consumed by a dataset associated with at least one of the first and second attributes; and
generating, based on the executing of the calculation scenario, a result data set and providing, by the database server to the application server, the result data set.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the one or more first attributes are one or more partition attributes for partitioning the one or more database tables stored at the database into one or more partitions.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the one or more second attributes are one or more ordering attributes for ordering rows of the one or more partitions.

### Claim 4 (depends on 3)

The method according to claim 3, further comprising, upon instantiation of the calculation scenario, dynamically removing at least one ordering attribute in the one or more ordering attributes.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the result data set corresponds to at least a portion of rows included in the one or more partitions of the one or more database tables stored at the database.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the executing of the calculation scenario includes performing the window function operation to generate the result data set corresponding to at least a portion of rows included in the one or more database tables stored at the database.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the node specifies a ranking filter operation.

### Claim 8 (depends on 1)

The method according to claim 1, wherein the calculation engine invokes an SQL processor for executing set operations.

### Claim 9 (depends on 1)

The method according to claim 1, wherein an input for each calculation node comprises one or more of: a physical index, a join index, an OLAP index, and another calculation node.

### Claim 10 (depends on 9)

The method according to claim 9, wherein each calculation node has at least one output table that is used to generate the data set.

### Claim 11 (depends on 10)

The method according to claim 10, wherein at least one calculation node consumes an output table of another calculation node.

### Claim 12 (depends on 1)

The method according to claim 1, wherein the database is a column-oriented in-memory database.

### Claim 13

A system comprising:
at least one programmable processor; and
a non-transitory machine-readable medium storing instructions that, when executed by the at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
receiving, by a database server from an application server, a query associated with a reusable calculation scenario defining a data flow model that includes one or more calculation nodes, each one or more calculation nodes corresponding to an operation being performed on one or more database tables stored at a database, the one or more calculation nodes including one or more nodes specifying a window function operation, the window function operation including one or more first attributes and one or more second attributes, wherein a portion of the calculation scenario not forming part of the received query being removed during instantiation of the calculation scenario;
executing, by a calculation engine, the calculation scenario, the executing including, using at least one of the first and second attributes, performing the window function operation on the one or more database tables stored at the database, at least one first calculation node in the one or more calculation nodes is executed by the calculation engine, and at least one second calculation node in the one or more calculation nodes is transformed into a set of logical database execution plans having a combination of a plurality of calculation nodes and corresponding operations, wherein each of the first and second attributes being associated with a corresponding rule configured to be triggered upon attributes exceeding a corresponding predetermined threshold, at least one rule being generated based on a determination of at least one of an estimated and an actual amount of memory consumed by a dataset associated with at least one of the first and second attributes; and
generating, based on the executing of the calculation scenario, a result data set and providing, by the database server to the application server, the result data set.

### Claim 14 (depends on 13)

The system according to claim 13, wherein the one or more first attributes are one or more partition attributes for partitioning the one or more database tables stored at the database into one or more partitions.

### Claim 15 (depends on 14)

The system according to claim 14, wherein the one or more second attributes are one or more ordering attributes for ordering rows of the one or more partitions.

### Claim 16 (depends on 15)

The system according to claim 15, wherein the operations further comprise, upon instantiation of the calculation scenario, dynamically removing at least one ordering attribute in the one or more ordering attributes.

### Claim 17 (depends on 13)

The system according to claim 13, wherein the result data set corresponds to at least a portion of rows included in the one or more partitions of the one or more database tables stored at the database.

### Claim 18 (depends on 13)

The system according to claim 13, wherein the executing of the calculation scenario includes performing the window function operation to generate the result data set corresponding to at least a portion of rows included in the one or more database tables stored at the database.

### Claim 19 (depends on 13)

The system according to claim 13, wherein the node specifies a ranking filter operation.

### Claim 20

A computer program product comprising a non-transitory machine-readable medium storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
receiving, by a database server from an application server, a query associated with a reusable calculation scenario defining a data flow model that includes one or more calculation nodes, each one or more calculation nodes corresponding to an operation being performed on one or more database tables stored at a database, the one or more calculation nodes including one or more nodes specifying a window function operation, the window function operation including one or more first attributes and one or more second attributes, wherein a portion of the calculation scenario not forming part of the received query being removed during instantiation of the calculation scenario;
executing, by a calculation engine, the calculation scenario, the executing including, using at least one of the first and second attributes, performing the window function operation on the one or more database tables stored at the database, at least one first calculation node in the one or more calculation nodes is executed by the calculation engine, and at least one second calculation node in the one or more calculation nodes is transformed into a set of logical database execution plans having a combination of a plurality of calculation nodes and corresponding operations, wherein each of the first and second attributes being associated with a corresponding rule configured to be triggered upon attributes exceeding a corresponding predetermined threshold, at least one rule being generated based on a determination of at least one of an estimated and an actual amount of memory consumed by a dataset associated with at least one of the first and second attributes; and
generating, based on the executing of the calculation scenario, a result data set and providing, by the database server to the application server, the result data set.
