# US 2014/0207756 A1 · Using temporary performance objects for enhanced query performance

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

- Number: US 2014/0207756 A1
- Document ID: US20140207756A1
- Status: Published application
- Kind: A1
- Application number: 14/219,744
- Filed: 2014-03-19
- Published: 2014-07-24
- Earliest claimed: 2012-12-19
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: David L. Kaminsky; Ramya H. Prasad; Girish Sundaram
- Web page: https://patentgrep.com/patent/US20140207756A1

## CPC

- G06F 16/2453: Query optimisation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods for optimizing query performance in a relational database management system. A query is received at the relational database management system. It is determined whether the query is expected to be a long-running query. In response to determining that the query is expected to be a long-running query, a full table scan is started in order to fetch records needed to satisfy the query from the relational database management system. In parallel with conducting the full table scan, a performance object is built, which is capable of satisfying the query in the relational database management system. In response to completing the construction of the performance object prior to completing the full table scan, the full table scan is stopped and the newly built performance object is used instead to satisfy the query.

## Claims

### Claim 1

A computer-implemented method for optimizing query performance in a relational database management system, comprising:
receiving, by a processor, a query at the relational database management system;
determining, by the processor, whether the query is expected to be a long-running query;
in response to determining that the query is expected to be a long-running query,
starting, by the processor, a full table scan to fetch records needed to satisfy the query from the relational database management system;
in parallel with conducting the full table scan, building, by the processor, a performance object capable of satisfying the query in the relational database management system; and
in response to completing the construction of the performance object prior to completing the full table scan, stopping the full table scan and using the newly built performance object instead to satisfy the query.

### Claim 2 (depends on 1)

The method of claim 1, wherein the performance object includes one or more of:
a Materialized Query Table, a Multidimensional Clustered Table, an index and a temporary table.

### Claim 3 (depends on 1)

The method of claim 1, wherein stopping the full table scan includes:
stopping the full table scan at a hold position in each table undergoing the full table scan in accordance with a first query plan;
migrating to a second query plan; and
locating the corresponding hold position in the performance object;
continuing the query at the corresponding hold position in the performance object, using a second query plan.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
prior to starting to build the performance object, determining what type of performance object would be most beneficial, wherein the determination takes into account both local and exogenous factors.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
in response to completing the full table scan prior to completing the construction of the performance object, stopping the construction of the performance object and deleting the performance object from memory.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
storing the performance object in storage or memory for a predetermined time period, whereby the performance object can be usable in conjunction with future queries.

### Claim 7 (depends on 1)

The method of claim 1, wherein determining whether the query is expected to be a long-running query includes:
examining sources exogenous to the relational database management system, which sources are referenced by the query, to determine whether the query is expected to be long running

### Claim 8 (depends on 1)

The method of claim 1, wherein determining whether the query is expected to be long-running includes:
estimating a time required to satisfy the query; and
comparing the estimated time required to satisfy the query to a threshold value representing a time for a query considered to be a long-running query.
