# US 2006/0080345 A1 · Mechanism for efficient maintenance of XML index structures in a database system

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

- Number: US 2006/0080345 A1
- Document ID: US20060080345A1
- Status: Published application
- Kind: A1
- Application number: 11/286,873
- Filed: 2005-11-22
- Published: 2006-04-13
- Earliest claimed: 2004-07-02
- Assignees: Oracle International Corporation
- Inventors: Ravi Murthy; Sivasankaran Chandrasekar; Eric Sedlar; Nipun Agarwal
- Web page: https://patentgrep.com/patent/US20060080345A1

## CPC

- G06F 16/2228: {Indexing structures}
- G06F 16/81: Indexing, e.g. XML tags; Data structures therefor; Storage structures
- G06F 16/8373: {Query execution}
- G06F 16/86: {Mapping to a database}
- G06F 40/123: Storage facilities
- G06F 40/131: Fragmentation of text files, e.g. creating reusable text-blocks; Linking to fragments, e.g. using XInclude; Namespaces
- G06F 40/143: Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for efficiently maintaining XML index structures in a database system is provided. Instead of immediately synchronizing the XML index structures for every change submitted to the database, the changes are stored in a PENDING table. The XML index structures are periodically synchronized, based on certain criteria or at a user's discretion. Between synchronizations, the XML index structures may be in stale mode or current mode. If in stale mode, a request to access indexed information will use the XML index structures to find the desired indexed information without checking the PENDING table. If in current mode, a request to access indexed information will search the XML index structures and also check the PENDING table to determine 1) whether the indexed information has been updated or deleted, and 2) whether information relevant to the request has been inserted or updated.

## Claims

### Claim 1

A method comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of:
A) sending said instructions over transmission media;
B) receiving said instructions over transmission media;
C) storing said instructions onto a machine-readable storage medium; and
D) executing the instructions;
wherein said instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of:
when changes are made to indexed information, storing an indication that an index has to be changed, wherein the step of storing an indication is performed in a first operation that is synchronous relative to the changes, wherein the index is not changed during said first operation; and
in response to detecting that certain conditions have been satisfied, performing a second operation that updates the index and removes the indications that the index has to be changed, wherein the second operation is performed asynchronously relative to the changes made to the indexed information.

### Claim 2 (depends on 1)

The method as in claim 1, wherein said certain conditions are satisfied by a user providing user input that specifies that the index is to be updated to reflect the changes.

### Claim 3 (depends on 1)

The method as in claim 1, wherein the indexed information is XML.

### Claim 4 (depends on 1)

The method as in claim 1, wherein:
a pending table stores the indications,
the indexed information is information in one or more documents, and
the certain conditions include at least one of:
the lapse of a specified amount of time since a last synchronization,
the size of all documents, corresponding to pending changes stored in the pending table, exceeds a specified size,
the number of documents specified in the pending table exceeds a specified limit; and
resource utilization has reached a specified level.

### Claim 5 (depends on 1)

The method as in claim 1, wherein each indication is associated with:
an opcode number, which identifies an operation being performed; and
a document identifier, which identifies a document affected by the operation.

### Claim 6 (depends on 5)

The method as in claim 5, wherein each indication is also associated with an order key value, which identifies a particular node or subtree in the document affected by the operation.

### Claim 7 (depends on 1)

The method as in claim 1, wherein the second operation comprises the steps of:
disabling the index and any secondary indexes,
for each indication,
if the operation associated with the indication is a deletion, deleting the index entries corresponding to the indication;
if the operation associated with the indication is an insertion, generating and inserting index entries corresponding to the indication; and
if the operation associated with the indication is an update, deleting the index entries corresponding to the indication, and generating and inserting index entries corresponding to the indication;
enabling the index and any secondary indexes; and
deleting all indications.

### Claim 8 (depends on 1)

The method as in claim 1, further comprising storing data that indicates whether the index is to be maintained asynchronously or synchronously, wherein if the data is changed to indicate that the index is to be maintained synchronously, then changes made to the indexed information during a subsequent operation causes the index to be changed during the subsequent operation.

### Claim 9 (depends on 1)

The method as in claim 1 further comprising storing data that indicates whether the index is to be maintained in asynchronous stale mode or asynchronous current mode.

### Claim 10 (depends on 9)

The method as in claim 9, further comprising the steps of:
receiving a request to access indexed information;
reading the data to determine whether the index is in asynchronous stale mode or in asynchronous current mode;
if the index is in asynchronous stale mode, then using the index to access and return the indexed information; and
if the index is in asynchronous current mode, then
using the index to access the indexed information and determining, from the one or more stored indications, whether any portion of the accessed information has been deleted or updated, and if a portion of the accessed information has been deleted or updated, not responding to the request with the accessed information; and
examining the one or more stored indications for inserted and updated information that relates to the request.

### Claim 11 (depends on 1)

The method as in claim 1, wherein:
the index is associated with one or more secondary indexes; and
a subset of all indexes is synchronized more frequently than a different subset of the same indexes based on a second set of certain conditions.
