# US 2018/0025055 A1 · Fault-tolerant database query execution plans using non-volatile memories

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

- Number: US 2018/0025055 A1
- Document ID: US20180025055A1
- Status: Published application
- Kind: A1
- Application number: 15/213,626
- Filed: 2016-07-19
- Published: 2018-01-25
- Earliest claimed: 2016-07-19
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Ahmad Hassan
- Web page: https://patentgrep.com/patent/US20180025055A1

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/24561: {Intermediate data storage techniques for performance improvement}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Implementations of the present disclosure include methods, systems, and computer-readable storage mediums for receiving a query, retrieving an annotated query execution plan (QEP) that is associated with the query, the annotated QEP including a plurality of operators in respective lines, which are executed to provide a query result, at least one line having annotations for check-pointing an intermediate result provided by a respective operator, and determining that a power failure occurred during execution of the annotated QEP in an in-memory database system, and in response: determining that a checkpoint for the at least one line is stored in non-volatile memory (NVM), retrieving the intermediate result provided by the respective operator from the NVM, and restarting execution of the annotated QEP using the intermediate result as input to an operator provided in a line following the at least one line.

## Claims

### Claim 1

A computer-implemented method executed by one or more processors, the method comprising:
receiving, by the one or more processors, a query;
retrieving, by the one or more processors, an annotated query execution plan (QEP) that is associated with the query, the annotated QEP comprising a plurality of operators in respective lines, which are executed to provide a query result, at least one line having annotations for check-pointing an intermediate result provided by a respective operator; and
determining, by the one or more processors, that a power failure occurred during execution of the annotated QEP in an in-memory database system, and in response:
determining that a checkpoint for the at least one line is stored in non-volatile memory (NVM),
retrieving the intermediate result provided by the respective operator from the NVM, and
restarting execution of the annotated QEP using the intermediate result as input to an operator provided in a line following the at least one line.

### Claim 2 (depends on 1)

The method of claim 1, further comprising providing the annotated QEP by:
retrieving a QEP associated with the query;
executing the QEP in the in-memory database system;
for each operator in the QEP, determining a cost; and
selectively annotating one or more lines based on costs determined for respective operators.

### Claim 3 (depends on 2)

The method of claim 2, wherein the cost comprises a time to execute a respective operator to provide an intermediate result.

### Claim 4 (depends on 2)

The method of claim 2, wherein a line is annotated in response to a cost of a respective operator exceeding a threshold.

### Claim 5 (depends on 1)

The method of claim 1, wherein the annotations comprise a persist annotation inserted in a line immediately preceding the at least one line, and a commit annotation inserted in a line immediately following the at least one line.

### Claim 6 (depends on 1)

The method of claim 1, further comprising retrieving metadata associated with the intermediate results, the metadata comprising session information and a process state.

### Claim 7 (depends on 1)

The method of claim 1, further comprising providing a query result to the query upon completing execution of the annotated QEP.

### Claim 8

A non-transitory computer-readable storage medium coupled to one or more processors and having instructions stored thereon which, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
receiving a query;
retrieving an annotated query execution plan (QEP) that is associated with the query, the annotated QEP comprising a plurality of operators in respective lines, which are executed to provide a query result, at least one line having annotations for check-pointing an intermediate result provided by a respective operator; and
determining that a power failure occurred during execution of the annotated QEP in an in-memory database system, and in response:
determining that a checkpoint for the at least one line is stored in non-volatile memory (NVM),
retrieving the intermediate result provided by the respective operator from the NVM, and
restarting execution of the annotated QEP using the intermediate result as input to an operator provided in a line following the at least one line.

### Claim 9 (depends on 8)

The computer-readable storage medium of claim 8, wherein operations further comprise providing the annotated QEP by:
retrieving a QEP associated with the query;
executing the QEP in the in-memory database system;
for each operator in the QEP, determining a cost; and
selectively annotating one or more lines based on costs determined for respective operators.

### Claim 10 (depends on 9)

The computer-readable storage medium of claim 9, wherein the cost comprises a time to execute a respective operator to provide an intermediate result.

### Claim 11 (depends on 9)

The computer-readable storage medium of claim 9, wherein a line is annotated in response to a cost of a respective operator exceeding a threshold.

### Claim 12 (depends on 8)

The computer-readable storage medium of claim 8, wherein the annotations comprise a persist annotation inserted in a line immediately preceding the at least one line, and a commit annotation inserted in a line immediately following the at least one line.

### Claim 13 (depends on 8)

The computer-readable storage medium of claim 8, wherein operations further comprise retrieving metadata associated with the intermediate results, the metadata comprising session information and a process state.

### Claim 14 (depends on 8)

The computer-readable storage medium of claim 8, wherein operations further comprise providing a query result to the query upon completing execution of the annotated QEP.

### Claim 15

A system, comprising:
a computing device; and
a computer-readable storage device coupled to the computing device and having instructions stored thereon which, when executed by the computing device, cause the computing device to perform operations comprising:
receiving a query;
retrieving an annotated query execution plan (QEP) that is associated with the query, the annotated QEP comprising a plurality of operators in respective lines, which are executed to provide a query result, at least one line having annotations for check-pointing an intermediate result provided by a respective operator; and
determining that a power failure occurred during execution of the annotated QEP in an in-memory database system, and in response:
determining that a checkpoint for the at least one line is stored in non-volatile memory (NVM),
retrieving the intermediate result provided by the respective operator from the NVM, and
restarting execution of the annotated QEP using the intermediate result as input to an operator provided in a line following the at least one line.

### Claim 16 (depends on 15)

The system of claim 15, wherein operations further comprise providing the annotated QEP by:
retrieving a QEP associated with the query;
executing the QEP in the in-memory database system;
for each operator in the QEP, determining a cost; and
selectively annotating one or more lines based on costs determined for respective operators.

### Claim 17 (depends on 16)

The system of claim 16, wherein the cost comprises a time to execute a respective operator to provide an intermediate result.

### Claim 18 (depends on 16)

The system of claim 16, wherein a line is annotated in response to a cost of a respective operator exceeding a threshold.

### Claim 19 (depends on 15)

The system of claim 15, wherein the annotations comprise a persist annotation inserted in a line immediately preceding the at least one line, and a commit annotation inserted in a line immediately following the at least one line.

### Claim 20 (depends on 15)

The system of claim 15, wherein operations further comprise retrieving metadata associated with the intermediate results, the metadata comprising session information and a process state.
