Query Plan Reordering for Result Streaming Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query optimization techniques fail to effectively optimize result streaming due to dependencies between restart and result pipelines, leading to suboptimal performance and resource inefficiencies.

Innovation Solution

The system reorders query plans to execute restart pipelines before result pipelines when there is no dependency, allowing for optimized result streaming by enabling partial data processing and reducing the need for all data to be processed simultaneously.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If restart pipelines are executed before result pipelines in the query plan, then result streaming optimization is enabled and query performance is improved, but pipeline execution order constraints are introduced

Engineering Contradiction:
Improvequery performanceVSAvoidpipeline execution order constraints
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The query plan is segmented into distinct pipeline types (restart pipelines and result pipelines) that can be independently identified and reordered. This segmentation allows the system to apply specific execution rules to different pipeline segments, enabling result streaming optimization without requiring complete reordering of all operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Restart pipelines are executed as preliminary actions before result pipelines. By performing restart operations first, the system ensures that any necessary query plan restarts are completed before result streaming begins, enabling optimized result streaming while maintaining proper execution semantics.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If all data is processed simultaneously in traditional query execution, then complete results are ensured, but computational resources are inefficiently utilized and response times are increased

Engineering Contradiction:
Improveresource efficiencyVSAvoidresponse time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system applies partial action by processing and returning results incrementally rather than waiting for complete data processing. Result pipelines can stream partial results to clients as they become available, improving resource efficiency and reducing perceived response time while still ensuring complete results are eventually delivered.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

Result streaming enables continuous useful action by maintaining query execution and result delivery as ongoing processes rather than batch operations. The system continuously processes data and streams results without interruption, maximizing resource utilization and providing timely responses to client requests.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS12164519B2Result streaming by reordering pipelines
Publication Date: 2024.12.10 SAP SE
  • US12164519B2 patent drawing
  • US12164519B2 patent drawing
  • US12164519B2 patent drawing

AI summary

In some example embodiments, there is provided a method that includes receiving a query for query plan generation and query plan optimization; detecting whether the query plan includes a restart pipeline, the restart pipeline including one or more first operators that cause a query plan restart; detecting whether the query plan includes a result pipeline, the result pipeline including one or more second operators that provide result streaming; determining whether there is a dependency between execution of the restart pipeline and execution of the result pipeline; in response to determining there is no dependency, reordering the restart pipeline in the query plan such that the restart pipeline will be executed before the result pipeline in order to enable result streaming optimization; and providing the reordered query plan for execution. Related systems and computer program products are also provided.