Top-K Query Heap Materialization for In-Memory Databases

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database query optimization methods for top k queries face inefficiencies due to excessive materialization of values during heap sort, leading to resource bottlenecks and poor performance, particularly in in-memory databases using dictionary compression.

Innovation Solution

Implementing selective materialization techniques during top k query operations, where only necessary values are materialized based on comparison results, reducing unnecessary materialization and optimizing resource utilization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If all values are materialized during heap sort in top k queries, then complete data is available for accurate comparison and result generation, but resource consumption increases and performance deteriorates

Engineering Contradiction:
Improvequery result accuracyVSAvoidquery execution performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies partial action by materializing only the necessary portion of data (first value from first column) during heap sort operations, rather than materializing all values from all columns. This selective materialization reduces resource consumption while maintaining sufficient information for accurate top k query results, directly resolving the contradiction between complete data availability and performance efficiency

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If selective materialization is implemented, then resource consumption is reduced and query performance improves, but implementation complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidmaterialization logic complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the materialization process into distinct stages: reading the first value identifier, selectively materializing only the first value from the first column, comparing with heap top element, and conditionally materializing the second value from the second column only when needed. This segmentation of the materialization logic into manageable, conditional steps reduces overall implementation complexity while maintaining query execution efficiency

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20260064690A1Optimized materialization in top-k queries
Publication Date: 2026.03.05 SAP SE
  • US20260064690A1 patent drawing
  • US20260064690A1 patent drawing
  • US20260064690A1 patent drawing

AI summary

In some implementations, there is provided query execution optimization for a top k query that includes in response to a first value being less than a first heap value, selectively materializing a second value corresponding to a second field and inserting the first value and the second value into the heap, and in response to the first value not being less that the first heap value, skipping the first incoming element and proceeding, when available, to another incoming element. Related systems, methods and articles of manufacture are also disclosed.