Partition Injection for Efficient SQL Analytic Query Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query execution plans for analytic functions on multiple measures or dimensions repeat intermediate operations, such as sorting, for each analytic operation, leading to inefficiencies due to serial execution and repeated use of partitioning keys.

Innovation Solution

The introduction of partition creator and partition iterator operators allows for the creation of partitions based on common partition keys, enabling multiple analytic operations to be executed serially on each partition, ignoring partition keys during ranking, thus reducing redundant operations and improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If analytic operations are executed separately and serially on a single-row flow, then each analytic operation can be performed independently with its own sorting, but the same intermediate sorting operations are repeated for each analytic operation, leading to inefficiency

Engineering Contradiction:
Improvecorrectness of analytic operationsVSAvoidquery execution efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the data flow into separate partitioned streams using partitioning operators. Each partition contains rows with identical partition key values, allowing independent processing. This segmentation enables the system to avoid repeating sorting operations across the entire dataset for each analytic function, as sorting is performed once per partition rather than repeatedly on the full single-row flow.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary sorting and partitioning operations before executing multiple analytic functions. By pre-sorting the data within each partition based on the partitioning keys, the system prepares the data in an optimized state that can be reused by subsequent analytic operations. This preliminary action eliminates the need to re-sort data for each analytic function, significantly improving execution efficiency.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If intermediate sorting is repeated for each analytic operation on the same partitioning, then each operation maintains its own sorting order, but computational overhead increases due to redundant sorting operations

Engineering Contradiction:
Improveaccuracy of ranking resultsVSAvoidexecution time for repeated sorting
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent merges multiple analytic operations into a unified execution framework that shares common sorting infrastructure. Instead of executing separate sorting operations for each analytic function, the system combines them into a single sorted data flow that serves all analytic operations. This merging eliminates redundant sorting while maintaining the accuracy of ranking results through consistent application of partitioning and sorting logic across all operations.

Inventive Principle:
Principle #5Merging (Combining)

3Stability of the object's composition

If partitioning keys are used for every analytic operation, then consistent partitioning is maintained across operations, but redundant use of partitioning keys increases computational overhead

Engineering Contradiction:
Improveconsistency of partitioningVSAvoidcomputational overhead from repeated partitioning
Core Design Contradiction:
Stability of the object's compositionVSDevice complexity

Solution Approach 1:

The patent extracts the partitioning operation from each individual analytic function and performs it once at the beginning of the data flow. The partitioning keys are applied once to divide the data into partitions, and subsequent analytic operations work on these pre-partitioned streams without repeatedly applying partitioning logic. This extraction maintains consistent partitioning across all operations while eliminating the redundant computational overhead of repeated partitioning applications.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11301468B2Efficient execution of a sequence of SQL operations using runtime partition injection and iterative execution
Publication Date: 2022.04.12 ORACLE INT CORP
  • US11301468B2 patent drawing
  • US11301468B2 patent drawing
  • US11301468B2 patent drawing

AI summary

Execution plans generated for multiple analytic queries incorporate two new kinds of plan operators, a partition creator and partition iterator. The partition creator and partition iterator operate as a pair. A partition creator operator creates partitions of rows and a partitioning descriptor describing the partitions created. A partition iterator iterates through the partitions based on the partitioning descriptor. For each partition, multiple analytic operators are executed serially, one after the other, on the same rows in the partition. According to an embodiment, partitioning is based on a common grouping or subgrouping of the multiple analytic functions or operators. Columns in the grouping or subgrouping may be ignored when executing each of the multiple analytic operators. Forming execution plans that include partition creator and partition iterator in this way is referred to herein as partitioning injection.