# US 2017/0255677 A1 · Preventing staleness in query results when using asynchronously updated indexes

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

- Number: US 2017/0255677 A1
- Document ID: US20170255677A1
- Status: Published application
- Kind: A1
- Application number: 15/602,159
- Filed: 2017-05-23
- Published: 2017-09-07
- Earliest claimed: 2015-10-27
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Marion E. Behnen; Joern Klauke; Jens P. Seifert; Calisto P. Zuzarte
- Web page: https://patentgrep.com/patent/US20170255677A1

## CPC

- G06F 16/2456: {Join operations}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/2455: Query execution
- G06F 16/24558: {Binary matching operations}
- G06F 16/284: {Relational databases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, computer program product, and computer system for optimizing query processing is provided. An asynchronously updated index is provided for a main dataset. A time-sequences log of data modifications to the main dataset is provided. A query of the main dataset is received. The main dataset is joined with the time-sequenced log data resulting in a first intermediate result. The query is processed by keeping one or more entries satisfying the query by emulating a function of the asynchronously updated index resulting in a second intermediate result. Updated, deleted dataset entries are deleted from the asynchronously updated index. The query is processed resulting in a third intermediate result. A union of the second intermediate result and third intermediate result is built defining a final result.

## Claims

### Claim 1

A method, the method comprising:
providing, by one or more processors, an asynchronously updated index for a main dataset in a database system;
providing, by one or more processors, a time-sequenced log data of modifications to the main dataset, wherein the log data of modifications includes at least one of (i) an addition, (ii) an update and (iii) a deletion of affected entries of the main dataset after a cutoff time of a last asynchronous index update;
receiving, by one or more processors, a query of the main dataset;
joining, by one or more processors, the main dataset with the time-sequenced log data resulting in a first intermediate result comprising one or more entry of the main dataset after the cutoff time, wherein the one or more entry is at least one of (i) inserted, (ii) updated, and (iii) deleted;
processing, the one or more processors, the query by keeping the one or more entries satisfying the query by emulating a function of the asynchronously updated index access resulting in a second intermediate result;
filtering, by one or more processors, at least one of (i) an out updated dataset entry and (ii) a deleted dataset entry from the asynchronously updated index using the time-sequenced log data building a lookup table;
processing, by one or more processors, the query against the base table using the lookup table resulting in a third intermediate result; and
building, by one or more processors, a union of the second intermediate result and the third intermediate result defining a final result of the query.

### Claim 2 (depends on 1)

The method of claim 1, wherein the time-sequenced log data is read once by the database system for at least one of (a) joining the main dataset with the time-sequenced log data and (b) filtering out updated dataset entries and deleted dataset entries from the asynchronously updated index.

### Claim 3 (depends on 1)

The method of claim 1, wherein the database system is a relational database system.

### Claim 4 (depends on 3)

The method of claim 3, wherein each dataset is a table of the relational database system.

### Claim 5 (depends on 1)

The method of claim 1, wherein the asynchronously updated index is a text search index.

### Claim 6 (depends on 1)

The method of claim 1, wherein the asynchronously updated index is a spatial index.

### Claim 7 (depends on 1)

The method of claim 1, wherein the processing of the query further comprises:
determining, by one or more processors, whether one or more stale query results are acceptable.
