# US 2003/0229640 A1 · Parallel database query processing for non-uniform data sources via buffered access

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

- Number: US 2003/0229640 A1
- Document ID: US20030229640A1
- Status: Published application
- Kind: A1
- Application number: 10/165,235
- Filed: 2002-06-07
- Published: 2003-12-11
- Earliest claimed: 2002-06-07
- Assignees: International Business Machines Corporation
- Inventors: David Glenn Carlson; Tariq Mahmood Choudhry; Kevin James Kathmann
- Web page: https://patentgrep.com/patent/US20030229640A1

## CPC

- G06F 16/24553: {of query operations}
- G06F 16/24532: {of parallel queries}
- G06F 16/24554: {Unary operations; Data partitioning operations}
- G06F 16/24561: {Intermediate data storage techniques for performance improvement}
- Y10S 707/99933: Query processing, i.e. searching
- Y10S 707/99934: Query formulation, input preparation, or translation
- Y10S 707/99935: Query augmenting and refining, e.g. inexact access
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

An apparatus, program product and method utilize a dynamically-populated query buffer to facilitate the handling of at least a portion of a database query in parallel. A query is implemented using at least first and second portions, where the second portion of the query is executed in parallel using a plurality of threads. The first portion of the query is executed to dynamically populate a query buffer with records from a data source, and the plurality of threads that execute the second portion of the query are specified to the query buffer so that the effective data source for the second portion of the query comprises the records that are dynamically populated into the query buffer.

## Claims

### Claim 1

A method of executing a database query, the method comprising:
(a) executing a first portion of a query to dynamically populate a query buffer with records from a data source; and
(b) executing a second portion of the query in parallel using a plurality of threads specified to the query buffer.

### Claim 2 (depends on 1)

The method of claim 1, wherein executing the first portion of the query dynamically populates the query buffer with records from the data source that match a first query criterion, and wherein executing the second portion of the query includes selecting those records among those populated in the query buffer that match a second query criterion.

### Claim 3 (depends on 1)

The method of claim 1, wherein executing the first portion of the query is performed serially.

### Claim 4 (depends on 1)

The method of claim 1, wherein executing the first portion of the query is performed by a thread that is separate from the plurality of threads that execute the second portion of the query.

### Claim 5 (depends on 1)

The method of claim 1, wherein executing the first portion of the query is performed by a thread among the plurality of threads.

### Claim 6 (depends on 5)

The method of claim 5, wherein executing the first portion of the query is performed by different threads among the plurality of threads at different times.

### Claim 7 (depends on 6)

The method of claim 6, wherein executing the first portion of the query includes determining whether a thread among the plurality of threads has been drafted as a producer, and if so, serially executing the first portion of the query in the producer thread.

### Claim 8 (depends on 1)

The method of claim 1, wherein executing the second portion of the query consumes records from the query buffer in parallel with dynamically populating the query buffer.

### Claim 9 (depends on 1)

The method of claim 1, wherein the query buffer includes a plurality of entries, wherein executing the first portion of the query includes storing a record in an entry in the query buffer, and wherein executing the second portion of the database query includes, in each thread:
(a) retrieving an entry from the query buffer; and
(b) executing the second portion of the query on a record on the retrieved entry.

### Claim 10 (depends on 9)

The method of claim 9, wherein each entry is configured to store a plurality of records.

### Claim 11 (depends on 9)

The method of claim 9, wherein executing the first portion of the query includes populating at least one entry with a uniform set of records.

### Claim 12 (depends on 9)

The method of claim 9, wherein executing the first portion of the query includes populating at least one entry with a nonuniform set of records.

### Claim 13 (depends on 1)

The method of claim 1, wherein executing the first and second portion s of the query each include executing an attribute operation list associated with a node defined in a query object, the attribute operation list configured to manipulate at least one attribute described in an attribute descriptor array.

### Claim 14

An apparatus, comprising:
(a) a memory within which is resident at least a portion of a database; and
(b) program code configured to execute a query on the database, the program code configured to execute a first portion of the query to dynamically populate a query buffer with records from the database, and to execute a second portion of the query in parallel using a plurality of threads specified to the query buffer.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to execute the first portion of the query to dynamically populate the query buffer with records from the database that match a first query criterion, and wherein the program code is configured to execute the second portion of the query by selecting those records among those populated in the query buffer that match a second query criterion.

### Claim 16 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to serially execute the first portion of the query.

### Claim 17 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to execute the first portion of the query in a thread that is separate from the plurality of threads that execute the second portion of the query.

### Claim 18 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to execute the first portion of the query in a thread among the plurality of threads.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the program code is configured to execute the first portion of the query in different threads among the plurality of threads at different times.

### Claim 20 (depends on 19)

The apparatus of claim 19, wherein the program code is configured to execute the first portion of the query by determining whether a thread among the plurality of threads has been drafted as a producer, and if so, serially executing the first portion of the query in the producer thread.

### Claim 21 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to execute the second portion of the query to consume records from the query buffer in parallel with dynamically populating the query buffer.

### Claim 22 (depends on 14)

The apparatus of claim 14, wherein the query buffer includes a plurality of entries, wherein the program code is configured to execute the first portion of the query by storing a record in an entry in the query buffer, and wherein the program code is configured to execute the second portion of the database query by, in each thread:
(a) retrieving an entry from the query buffer; and
(b) executing the second portion of the query on a record on the retrieved entry.

### Claim 23 (depends on 22)

The apparatus of claim 22, wherein each entry is configured to store a plurality of records.

### Claim 24 (depends on 22)

The apparatus of claim 22, wherein the program code is configured to execute the first portion of the query by populating at least one entry with a uniform set of records.

### Claim 25 (depends on 22)

The apparatus of claim 22, wherein the program code is configured to execute the first portion of the query by populating at least one entry with a non-uniform set of records.

### Claim 26 (depends on 14)

The apparatus of claim 14, wherein the program code is configured to execute the first and second portions of the query each by executing an attribute operation list associated with a node defined in a query object, the attribute operation list configured to manipulate at least one attribute described in an attribute descriptor array.

### Claim 27

A program product, comprising:
(a) program code configured to execute a database query, the program code configured to execute a first portion of the query to dynamically populate a query buffer with records from a data source, and to execute a second portion of the query in parallel using a plurality of threads specified to the query buffer; and
(b) a signal bearing medium bearing the program code.

### Claim 28 (depends on 27)

The program product of claim 27, wherein the signal bearing medium includes at least one of a transmission medium and a recordable medium.
