# US 2017/0371748 A1 · System and method for creating selective snapshots of a database

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

- Number: US 2017/0371748 A1
- Document ID: US20170371748A1
- Status: Published application
- Kind: A1
- Application number: 15/700,564
- Filed: 2017-09-11
- Published: 2017-12-28
- Earliest claimed: 2015-05-13
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Eliezer LEVY; Antonios ILIOPOULOS; Shay GOIKHMAN; Israel GOLD
- Web page: https://patentgrep.com/patent/US20170371748A1

## CPC

- G06F 11/1451: {by selection of backup contents}
- G06F 11/1407: {Checkpointing the instruction stream}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 16/2308: {Concurrency control (transaction processing G06F9/466)}
- G06F 16/283: {Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/24542: {Plan optimisation}
- G06F 2201/80: Database-specific techniques
- G06F 2201/84: Using snapshots, i.e. a logical point-in-time copy of the data
- G06F 2212/1024: Latency reduction
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system is provided for creating selective snapshots of a database that is stored as one or more segments, wherein a segment comprises one or more memory pages. The system includes a memory storage comprising instructions and one or more processors in communication with the memory. The one or more processors execute the instructions to determine whether a snapshot process is configured to access a selected segment of the one or more segments, assign a positive mapping status to an accessed segment for which the determining unit has determined that it is accessed by the snapshot process and to assign a negative mapping status to a non-accessed segment, and create a snapshot comprises a step of forking the snapshot process with an address space that comprises a subset of the one or more segments.

## Claims

### Claim 1

A system for creating selective snapshots of a database stored as one or more segments, wherein a segment comprises one or more memory pages, the system comprising:
a memory storage comprising instructions; and
one or more processors in communication with the memory, with the one or more processors executing the instructions to:
determine whether a snapshot process is configured to access a selected segment of the one or more segments;
assign a positive mapping status to an accessed segment accessed by the snapshot process and assign a negative mapping status to a non-accessed segment; and
create a snapshot, comprising forking the snapshot process with an address space that comprises a subset of the one or more segments, wherein a non-mapped segment assigned a negative mapping status is not mapped in the address space.

### Claim 2 (depends on 1)

The system of claim 1, wherein the one or more processors further execute the instructions to determine whether the snapshot process is configured to access the selected segment before execution of the snapshot process is started.

### Claim 3 (depends on 1)

The system of claim 1, wherein the one or more processors further execute the instructions to determine during execution of an active snapshot process whether the active snapshot process is configured to access the selected segment during a remaining execution time of the active snapshot process.

### Claim 4 (depends on 1)

The system of claim 1, wherein the one or more processors further execute the instructions to compile a physical execution plan to be executed by the snapshot process, wherein preferably the compiled physical execution plan comprises an unmap command for a segment at a position in the physical execution plan when the segment is no longer accessed during a remaining execution time of the physical execution plan.

### Claim 5 (depends on 1)

The system of claim 1, wherein assigning a positive mapping status to an accessed segment comprises a step of calling a madvise operating system function with arguments that comprise an address and a size of the accessed segment and a MADV_NORMAL parameter.

### Claim 6 (depends on 1)

The system of claim 1, wherein assigning a negative mapping status to a non-accessed segment comprises a step of calling a madvise operating system function with arguments that comprise an address and a size of the non-accessed segment and a MADV_DONTFORK parameter.

### Claim 7

A method for creating selective snapshots of a database stored as one or more segments, wherein a segment comprises one or more memory pages, the method comprising:
a parent process determining whether a snapshot process is configured to access a selected segment of the one or more segments;
the parent process assigning a positive mapping status to the segment if the segment is accessed by the snapshot process and the parent process assigning a negative mapping status to the segment if the segment is not accessed by the snapshot process; and
the parent process creating a snapshot comprising forking the snapshot process, wherein a non-mapped segment assigned a negative mapping status is not mapped in an address space of the snapshot process.

### Claim 8 (depends on 7)

The method of claim 7, wherein the assigning the positive inheritable status to an accessed segment comprises:
setting a status variable of the accessed segment to the status variable OR-combined with a mask variable;
inserting a pointer to the accessed segment in a hash table; and
if the pointer is newly inserted in the hash table, setting a positive mapping status,
wherein the parent process creating the snapshot comprises updating the mask variable comprising rotating bit values of the mask variable.

### Claim 9 (depends on 8)

The system of claim 8, wherein creating the snapshot further comprises setting, for each segment in the hash table set, a negative mapping status if the segment status variable AND-combined with the mask variable is 0.

### Claim 10 (depends on 9)

The method of claim 9, wherein the method comprises a checkpointing method and wherein the snapshot process is configured to write a selective snapshot of the database that comprises a subset of the one or more segments to a persistent storage.

### Claim 11 (depends on 10)

The method of claim 10, wherein the parent process determining whether the snapshot process is configured to access the selected segment of the one or more segments comprises determining whether the selected segment has been changed in a previous checkpoint interval.

### Claim 12 (depends on 9)

The method of claim 9, wherein the method comprises a method for maintaining a hybrid online transaction processing (OLTP) and online analytical processing (OLAP) database system, and wherein the method comprises:
receiving an OLAP query; and
the snapshot process executing the OLAP query.

### Claim 13 (depends on 12)

The method of claim 12, further comprising the parent process compiling the snapshot process based on the OLAP query.

### Claim 14 (depends on 12)

The method of claim 12, wherein the parent process determining whether a snapshot process is configured to access a selected segment comprises the parent process creating a physical execution plan, wherein the parent process assigns a positive mapping status to a referenced segment that is referenced in the physical execution plan.

### Claim 15 (depends on 9)

The method of claim 9, further comprising:
determining a non-accessed segment that is no longer accessed by the snapshot process; and
unmapping the non-accessed segment.

### Claim 16

A non-transitory computer-readable media storing computer instructions, that when executed by one or more processors, cause the one or more processors to perform the steps of:
a parent process determining whether a snapshot process is configured to access a selected segment of the one or more segments;
the parent process assigning a positive mapping status to the segment if the segment is accessed by the snapshot process and the parent process assigning a negative mapping status to the segment if the segment is not accessed by the snapshot process; and
the parent process creating a snapshot comprising forking the snapshot process, wherein a non-mapped segment assigned a negative mapping status is not mapped in an address space of the snapshot process.
