# US 2013/0159286 A1 · Generation of a query plan for accessing a database

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

- Number: US 2013/0159286 A1
- Document ID: US20130159286A1
- Status: Published application
- Kind: A1
- Application number: 13/817,638
- Filed: 2010-10-01
- Published: 2013-06-20
- Earliest claimed: 2010-10-01
- Assignees: Telefonaktiebolaget LM Ericsson (publ)
- Inventors: David Manzano Macho; Luis Maria Lafuente Alvarez
- Web page: https://patentgrep.com/patent/US20130159286A1

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/24539: {using cached or materialised query results}
- G06F 16/24552: {Database cache management}
- G06F 16/8365: {Query optimisation}
- G06F 16/8373: {Query execution}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method of generating a query plan for accessing a database, comprising: receiving (S10) one or more electronic queries from a database client; and determining (S20) whether the received one or more queries form a part of a query pattern comprising a repeating sequence of a plurality of queries by determining whether the received one or more queries match a part of the sequence of queries. If the received one or more queries are determined to form a part of the query pattern, the method further comprises generating (S30) a query plan for executing one or more queries in the sequence that match the received one or more queries, and a query that is subsequent to the matching one or more queries in the sequence.

## Claims

### Claim at position 1

1-20. (canceled)

### Claim 21

A method of generating a query plan for accessing a database, comprising:
receiving one or more electronic queries from a database client;
determining whether the received one or more queries form a part of a set of ordered queries comprising a repeating sequence of a plurality of queries, by determining whether the received one or more queries match a part of the sequence of queries;
determining a Quality of Service measure: and
if the received one or more queries are determined to form a part of the set of ordered queries, retrieving a stored query plan for executing one or more queries in the sequence that match the received one or more queries, and a query that is subsequent to the matching one or more queries in the sequence,
wherein the query plan is selected from a plurality of stored query plans associated with the received one or more queries, the process of selecting a query plan comprising selecting a query plan from the plurality of stored query plans associated with the received one or more queries by comparing the determined Quality of Service measure with a respective Quality of Service figure associated with each of the plurality of query plans and selecting a query plan in dependence on the results of the comparison.

### Claim 22 (depends on 21)

A method according to claim 21, wherein the query plan comprises one or more procedures for executing queries to answer the queries in the sequence, the number of queries to be executed by the one or more procedures in the query plan being smaller than the number of queries in the sequence.

### Claim 23 (depends on 21)

A method according to claim 21, wherein:
determining the Quality of Service measure comprises retrieving a stored Quality of Service measure; and
the process of selecting a query plan comprises selecting a query plan from the plurality of stored query plans associated with the received one or more queries by comparing the retrieved Quality of Service measure with a respective Quality of Service figure associated with each of the plurality of query plans and selecting a query plan in dependence on the results of the comparison.

### Claim 24 (depends on 21)

A method according to claim 21, wherein:
the Quality of Service measure is determined by receiving from the database client an indication of a Quality of Service required thereby; and
the process of selecting a query plan comprises selecting a query plan from the plurality of stored query plans associated with the received one or more queries by comparing the received indication of the required Quality of Service with a respective Quality of Service figure associated with each of the plurality of query plans and selecting a query plan in dependence on the results of the comparison.

### Claim 25 (depends on 21)

A method according to claim 21, further comprising:
executing at least a part of the selected query plan;
determining at least one Quality of Service figure associated with the execution; and
storing a Quality of Service figure for the selected query plan in accordance with the determined Quality of Service figure associated with the execution.

### Claim 26

An apparatus operable to generate a query plan for accessing a database, the apparatus comprising:
a receiver operable to receive one or more electronic queries from a database client;
a Quality of Service determining unit operable to determine a Quality of Service measure;
a pattern detection unit operable to determine whether the received one or more queries form a part of a set of ordered queries comprising a repeating sequence of a plurality of queries by determining whether the received one or more queries match a part of the sequence of queries; and
a query plan generator operable to retrieve a stored a query plan for executing one or more queries in the sequence that match the received one or more queries, and a query that is subsequent to the matching one or more queries in the sequence,
wherein the query plan generator is operable to select the query plan from a plurality of stored query plans associated with the received one or more queries by comparing the determined Quality of Service measure with a respective Quality of Service figure associated with each of the plurality of query plans, and selecting a query plan in dependence on the results of the comparison.

### Claim 27 (depends on 26)

An apparatus according to claim 26, wherein the query plan generator is operable to generate a query plan comprising one or more procedures for executing queries to answer the queries in the sequence, the number of queries to be executed by the one or more procedures in the query plan being smaller than the number of queries in the sequence.

### Claim 28 (depends on 26)

An apparatus according to claim 26, wherein:
the Quality of Service determining unit is operable to determine the Quality of Service measure by retrieving a stored value of the Quality of Service measure; and
the query plan generator is operable to select the query plan from the plurality of stored query plans associated with the received one or more queries by comparing the retrieved Quality of Service measure with a respective Quality of Service figure associated with each of the plurality of query plans and selecting a query plan in dependence on the results of the comparison.

### Claim 29 (depends on 26)

An apparatus according to claim 26, wherein:
the Quality of Service determining unit is operable to determine the Quality of Service measure by receiving from the database client an indication of a Quality of Service required thereby; and
the query plan generator is operable to select the query plan from the plurality of stored query plans associated with the received one or more queries by comparing the received indication of the required Quality of Service with a respective Quality of Service figure associated with each of the plurality of query plans and selecting a query plan in dependence on the results of the comparison.

### Claim 30 (depends on 26)

An apparatus according to claim 26, further comprising:
a query plan execution unit operable to execute at least a part of the selected query plan; and
wherein the Quality of Service determining unit is further operable to:
determine at least one Quality of Service figure associated with the execution; and
store a Quality of Service figure for the selected query plan in accordance with the determined Quality of Service figure associated with the execution.

### Claim 31 (depends on 21)

A computer-readable storage medium storing computer program instructions which, if executed by a processor, cause the processor to perform a method as set out in claim 21.

### Claim 32 (depends on 21)

A signal carrying computer program instructions which, if executed by a processor, cause the processor to perform a method as set out in claim 21.
