Just-In-Time Compilation for Database Aggregation Cache Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional aggregation techniques in database systems face challenges such as synchronization, cache utilization, non-uniform access characteristics, multiple database columns, data skew, and optimal operator selection, leading to inefficiencies in processing large datasets, particularly in real-time queries of terabytes of data.

Innovation Solution

The use of just-in-time compilation to generate compilable code that creates hashmaps, aggregates elements into buckets based on partition identity, and rehashes these buckets to reduce the number of groups, allowing for efficient insertion and positioning of elements within the CPU cache, thereby optimizing CPU cache usage and reducing memory access bottlenecks.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If conventional aggregation techniques are used, then database queries can be performed, but cache utilization is poor and memory access bottlenecks occur

Engineering Contradiction:
Improvequery performanceVSAvoidmemory access
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent segments the aggregation process into multiple phases: initial hashing to create partitions, rehashing to create buckets, and final aggregation. This segmentation allows data to be processed in smaller chunks that fit within cache memory, reducing main memory accesses. Each phase operates on a subset of data, improving cache utilization and reducing memory bandwidth requirements.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a new dimensional approach by using hash-based partitioning and rehashing to organize data in a multi-level hierarchy. Instead of single-pass aggregation, data is reorganized across multiple dimensions (partitions → buckets → final groups), allowing efficient cache utilization at each level and reducing the overall memory access burden.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Quantity of substance

If databases grow in size to handle terabytes of data, then data volume increases, but real-time query efficiency decreases

Engineering Contradiction:
Improvedata volumeVSAvoidquery speed
Core Design Contradiction:
Quantity of substanceVSSpeed

Solution Approach 1:

The patent performs preliminary hashing and partitioning of data before the final aggregation step. By pre-organizing data into partitions and buckets using hash functions, the system prepares data in an optimized structure that enables faster final aggregation. This preliminary organization reduces the complexity of real-time queries on large datasets.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent changes the organizational parameters of data from conventional row-based or column-based storage to hash-based partitioning with multiple rehashing passes. This parameter change allows the system to handle terabytes of data efficiently by distributing data across multiple partitions and buckets, enabling parallel processing and reducing query time.

Inventive Principle:
Principle #35Parameter changes

3Power

If multiple processors with multiple cores are used, then processing power increases, but synchronization challenges arise

Engineering Contradiction:
Improveprocessing powerVSAvoidsynchronization
Core Design Contradiction:
PowerVSDevice complexity

Solution Approach 1:

The patent segments data processing across multiple processor cores by assigning different partitions to different cores. Each core independently processes its assigned partitions through the hashing and rehashing process, minimizing the need for inter-core synchronization. This segmentation approach allows parallel processing while reducing synchronization complexity.

Inventive Principle:
Principle #1Segmentation

4Reliability

If aggregation is performed on large datasets, then comprehensive results are achieved, but memory access bottlenecks increase

Engineering Contradiction:
Improveaggregation accuracyVSAvoidmemory access
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent segments the aggregation process into multiple cache-friendly passes, ensuring that each pass operates on data that fits within cache memory. This segmentation maintains aggregation accuracy by processing complete partitions and buckets while minimizing main memory accesses, thus reducing energy consumption without compromising result reliability.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentEP3098730B1Aggregating database entries by hashing
Publication Date: 2021.10.20 SAP SE
  • EP3098730B1 patent drawingFigure 1
  • EP3098730B1 patent drawingFigure 2~3
  • EP3098730B1 patent drawingFigure 4

AI summary

Aggregating input into hashtables using just-in-time compilation of compilable code in response to a database query. Compilable code can be generated that is configured to cause a programmable processor to produce one or more hashmaps based on the input database. The one or more hashmaps can correspond to each individual thread from the input. The compilable code can be configured to cause the one or more processors to insert the hashmaps into a scheduler. Compilable code can be generated that is configured to: aggregate elements from the one or more hashmaps into buckets of elements having the same partition identity; rehash the buckets of elements having the same partition identity to reduce the number of groups within the bucket; facilitate the merger of all non-empty elements from each target-partition into a merged-partition.