Chunked Query Execution with Ordered Index Tracking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Long-running queries in multi-version concurrency control (MVCC) databases consume significant resources and can take extensive time to complete, risking data version expiration or system crashes, leading to inefficient resource usage and restarts.

Innovation Solution

A query processing system (QPS) divides long-running queries into shorter-running queries executed in chunks, using an ordered index to track progress and resume from intermediate results, allowing for resource sharing and simultaneous data updates.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If long-running queries are executed against large datasets in MVCC databases, then complete data processing is achieved, but processing resources are monopolized for extended periods and data versions may expire causing query restarts

Engineering Contradiction:
Improvequery completionVSAvoidquery execution continuity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent divides a long-running query into multiple shorter query executions by using an ordered index to process data in sequential chunks. Each query execution processes a portion of the dataset and stores intermediate results, allowing the system to resume from the last successful chunk rather than restarting the entire query if a data version expires or system failure occurs.

Inventive Principle:
Principle #1Segmentation

2Productivity

If long-running queries are executed against large datasets in MVCC databases, then complete data processing is achieved, but processing resources are monopolized for extended periods

Engineering Contradiction:
Improvedata processing completenessVSAvoidprocessing resource consumption
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent segments the long-running query into multiple shorter query executions that process data in chunks. Each chunk is processed independently and intermediate results are stored, allowing processing resources to be released between chunks rather than being monopolized for the entire duration of processing a large dataset.

Inventive Principle:
Principle #1Segmentation

3Ease of operation

If long-running queries are divided into shorter queries executed in chunks, then resource monopolization is reduced and intermediate results can be shared, but query processing complexity increases

Engineering Contradiction:
Improveresource sharing capabilityVSAvoidquery processing mechanism
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent uses an ordered index structure that is prepared in advance to enable sequential access to data chunks. This preliminary organization of data allows the query processing system to efficiently divide and resume queries without requiring complex dynamic decision-making during execution, thus managing complexity while enabling resource sharing.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11921721B2Maintaining data across query executions of a long-running query
Publication Date: 2024.03.05 SALESFORCE INC
  • US11921721B2 patent drawing
  • US11921721B2 patent drawing
  • US11921721B2 patent drawing

AI summary

Disclosed herein are system, method, and computer program product embodiments for a query processing system. An embodiment operates by receiving a query associated with a table. An ordered index with entries that include key values that uniquely identifies a corresponding record in the table is determined. A last key value is initialized to store a minimum value for a data type of the key value. The query is executed as a union-all of a plurality of queries. While a count of selected records is less than or equal to a threshold quantity and at least one entry remains in the ordered index, an ordered next entry with a key value subsequent to the last key value in the index is identified, the corresponding record is selected from the table, the last key value is updated, the query is executed, and the count is incremented.