# US 2013/0159316 A1 · Disappearing index for more efficient processing of a database query

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

- Number: US 2013/0159316 A1
- Document ID: US20130159316A1
- Status: Published application
- Kind: A1
- Application number: 13/769,797
- Filed: 2013-02-18
- Published: 2013-06-20
- Earliest claimed: 2010-11-11
- Assignees: International Business Machines Corporation
- Inventors: Randy L. Egan; Roger A. Mittelstadt; Brian R. Muras
- Web page: https://patentgrep.com/patent/US20130159316A1

## CPC

- G06F 16/901: Indexing; Data structures therefor; Storage structures (for retrieval from the web G06F16/951)
- G06F 16/2255: {Hash tables}
- G06F 16/2453: Query optimisation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A disappearing index allows faster processing of a database query without the startup time of a prior art sparse index. The disappearing index starts as a full index but is trimmed of index values that point to a row in the table that is not selected by the query. Thus the traditional index disappears as it becomes a sparse index tailored to the query. The query is able to execute faster using the now sparse index since the target database table is not accessed for duplicate values in the base table of the query. The query optimizer may determine to use a disappearing index based on estimates of the number of duplicate values in the base table. When the query is complete, the created disappearing table may be discarded or used for other queries that match the selection of the query that created the disappearing index.

## Claims

### Claim 1

A computer-implemented method for processing a database query, the method comprising the steps of:
processing each value of a query operation by performing the following steps for each value of an initially full index to create a sparse index:
if the value is not in the index, then process the next value;
if the value is in the index, then apply the query selection to the value and determine if a row is selected;
if the row is not selected then remove the value from the index and go to the next value; and
if the row is selected, then process the next value.

### Claim 2 (depends on 1)

The method of claim 1 further comprising the steps of:
processing each value of the query operation by performing the following steps for each pointer in the index corresponding to the current value:
if no row is selected for the pointer then remove the pointer from the index;
if there is a row selected for the pointer, then go to the next pointer; and
if all the pointers are removed from the index, then remove the value from the index.

### Claim 3 (depends on 1)

The method of claim 1 wherein the initially full index comprises a bit map corresponding to the initially full index and the disappearing index mechanism removes values from the initially full index by changing a corresponding bit value in the bit map for query operations that do not select a record.

### Claim 4 (depends on 1)

The method of claim 1 wherein the initially full index comprises a hash table with keys grouped in buckets, and wherein the disappearing index mechanism removes values from the initially full index by removing the keys from the buckets in the hash table for query operations that do not select a record.

### Claim 5 (depends on 1)

The method of claim 1 wherein the disappearing index mechanism determines there are multiple pointers for a value in the index and removes pointers from values in the full index that point to a record that is not selected and removes the value from the index where all the pointers point to records that are not selected.

### Claim 6 (depends on 1)

The method of claim 1 wherein the created sparse index is maintained to use again for queries of the database.
