# US 2008/0306907 A1 · Redundant version information in history table that enables efficient snapshot querying

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

- Number: US 2008/0306907 A1
- Document ID: US20080306907A1
- Status: Published application
- Kind: A1
- Application number: 12/194,540
- Filed: 2008-08-20
- Published: 2008-12-11
- Earliest claimed: 2005-01-19
- Assignees: International Business Machines Corporation
- Inventors: Dilip Kumar Biswal; Isaac Kam-Chak Cheng; Cecilia O. Chu; Donald Lee Clare; Louis S.W. Mau
- Web page: https://patentgrep.com/patent/US20080306907A1

## CPC

- G06F 16/2329: {using versioning}
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/2322: {using timestamps}
- Y10S 707/99932: Access augmentation or optimizing
- Y10S 707/99933: Query processing, i.e. searching
- Y10S 707/99953: Recoverability
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A system for efficient snapshot querying include: providing a first version value for each data in a history table, where the first version value indicates a beginning of a period in which the data is valid; providing at least a second version value for each data in the history table, where the second version value indicates an end of the period in which the data is valid; receiving a request for a version of a database; and retrieving the data with the first version value less than or equal to the requested version and the second version value greater than or equal to the requested version. By maintaining a history table with redundant version information, the system is able to provide efficient snapshot querying while also avoiding the overhead burden of conventional approaches. No aggregates, joins, or sub-queries are required to retrieve a snapshot.

## Claims

### Claim 1

A system to query for a database snapshot with more than one version without requiring a query having aggregates, joins, and sub-queries, comprising:
a database comprising a data table and a history table having redundant version information, wherein for each change to the data table, a row is added to the history table; and
means for maintaining the history table, wherein the maintaining comprises:
providing a first version value for the added row in the history table, wherein the first version value indicates a beginning of a period in which a data value of the added row is valid, and
providing at least a second version value for the added row in the history table, wherein the second version value indicates an end of the period in which the data value of the added row is valid,
wherein when a request for a version of the database is received, the data values with the first version value less than or equal to the requested version and the second version value greater than or equal to the requested version are retrieved from the history table.

### Claim 2 (depends on 1)

The system of claim 1, wherein the mean_for maintaining:
determines that a change in a row in the data table has occurred; and
adds the row to the history table corresponding to the changed row, wherein the adding comprises:
setting the first version value for the added row to a current version, and
setting the second version value for the added row to a significantly large number.

### Claim 3 (depends on 2)

The system of claim 2, wherein the means_for maintaining:
determines that the change is a row insert; and
sets a delete Boolean value for the added row to ‘false’.

### Claim 4 (depends on 2)

The system of claim 2, wherein the means for maintaining:
determines that the change is a row delete;
sets a delete Boolean value for the added row to ‘true’; and
modifies an old row in the history table for a key of the changed row in the data table by changing its second version value to a previous version.

### Claim 5 (depends on 2)

The system of claim 2, wherein the means for maintaining:
determines that the change is a row update;
sets a delete Boolean value for the added row to ‘false; and
modifies an old row in the history table for a key of the changed row in the data table by changing its second version value to a previous version.

### Claim 6 (depends on 1)

The system of claim 1, wherein the means for maintaining:
performing a first scan of rows in the history table for rows with the first version value less than or equal to the requested version;
performing a second scan of rows in the history table for rows with the second version value greater than or equal to the requested version; and
determining an intersection of the first and second scans.

### Claim 7 (depends on 6)

The system of claim 6, wherein the first and second scans are indexed scans.

### Claim 8 (depends on 1)

The system of claim 1, wherein the retrieved data each has a delete Boolean value of ‘false’.

### Claim 9

A computer readable medium with program instructions for querying for a database snapshot with more than one version without requiring a query having aggregates, joins, and sub-queries, comprising:
providing a first version value for each data in a history table having redundant version information, wherein the first version value indicates a beginning of a period in which the data is valid;
providing at least a second version value for each data in the history table, wherein the second version value indicates an end of the period in which the data is valid;
receiving a request for a version of a database; and
retrieving the data with the first version value less than or equal to the requested version and the second version value greater than or equal to the requested version.

### Claim 10 (depends on 9)

The medium of claim 9, further comprising:
determining that a change in a row in the database has occurred; and
adding a row to the history table corresponding to the changed row, wherein the adding comprises:
setting the first version value for the added row to a current version, and
setting the second version value for the added row to a significantly large number.

### Claim 11 (depends on 10)

The medium of claim 10, wherein the adding further comprises:
determining that the change is a row insert; and
setting a delete Boolean value for the added row to ‘false’.

### Claim 12 (depends on 10)

The medium of claim 10, wherein the adding further comprises:
determining that the change is a row delete;
setting a delete Boolean value for the added row to ‘true’; and
modifying an old row in the history table for a key of the changed row by changing its second version value to a previous version.

### Claim 13 (depends on 10)

The medium of claim 10, wherein the adding further comprises:
determining that the change is a row update;
setting a delete Boolean value for the added row to ‘false; and
modifying an old row in the history table for a key of the changed row by changing its second version value to a previous version.

### Claim 14 (depends on 9)

The medium of claim 9, wherein the retrieving comprises:
performing a first scan of rows in the history table for rows with the first version value less than or equal to the requested version;
performing a second scan of rows in the history table for rows with the second version value greater than or equal to the requested version; and
determining an intersection of the first and second scans.

### Claim 15 (depends on 14)

The medium of claim 14, wherein the first and second scans are indexed scans.

### Claim 16 (depends on 9)

The medium of claim 9, wherein the retrieved data each has a delete Boolean value of ‘false’.
