Distributed In-Memory Database Query Execution Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing distributed in-memory database systems face significant challenges due to the duplication and storage of large result sets during query execution, leading to inefficiencies and increased memory usage.

Innovation Solution

The proposed solution involves a method where queries are distributed to multiple shards, and each shard generates array provider data structures that identify responsive identifiers. These data structures are then materialized, with a portion of the responsive data being persisted to disk while materializing, allowing for efficient merging and reduction of in-memory data footprint.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If each machine generates and stores complete result sets during query execution, then query processing can be performed in parallel across distributed machines, but significant data storage and memory usage is required

Engineering Contradiction:
Improvequery processing speedVSAvoiddata storage and memory usage
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments the result set into two distinct components: (1) a consolidated list of unique identifiers (IDs) representing all responsive records across shards, and (2) the actual data records themselves. This segmentation allows the system to first aggregate and deduplicate IDs in memory efficiently, then selectively materialize only the necessary data records to disk, thereby reducing peak memory consumption while maintaining parallel query processing capability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary aggregation of identifier lists from all shards before materializing the actual data records. By first collecting and consolidating the ID lists in memory (which are more compact than full result sets), the system prepares the groundwork for efficient data retrieval later. This preliminary action reduces the memory footprint during the intermediate processing stage while preserving the ability to generate complete result sets when needed.

Inventive Principle:
Principle #10Preliminary action

2Speed

If complete result sets are materialized in memory for each shard, then fast in-memory access is achieved, but data duplication occurs across multiple machines

Engineering Contradiction:
Improvedata access speedVSAvoiddata duplication
Core Design Contradiction:
SpeedVSLoss of substance

Solution Approach 1:

Instead of copying and materializing complete data result sets across all machines, the patent copies only the compact identifier lists from each shard to the central coordinating machine. These ID lists serve as references that can be quickly processed and deduplicated. The actual data records are then retrieved on-demand from the originating shards only when needed, eliminating redundant data duplication while maintaining fast access through efficient ID-based lookup.

Inventive Principle:
Principle #26Copying

3Productivity

If all responsive data is kept in memory during query execution, then immediate access and processing is possible, but memory resources are exhausted for large result sets

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidmemory resource consumption
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent implements a dynamic memory management strategy where the system adapts between in-memory and disk-based storage based on the size of the result set. For small to medium result sets, complete data can be kept in memory for fast access. For large result sets, the system automatically spills excess data to disk while maintaining the compact ID list in memory, thus dynamically adjusting resource usage to prevent memory exhaustion while preserving query execution efficiency.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent extracts and separates the identifier information from the actual data records. By taking out just the ID lists (which are significantly smaller than full result sets) and keeping them in memory, the system maintains fast processing capability for the critical identification and filtering operations. The bulkier data records are extracted from memory and stored on disk, reducing memory consumption while allowing on-demand retrieval when needed.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20250200038A1Optimized ephemeral query execution in a distributed in-memory database
Publication Date: 2025.06.19 WORKDAY INC
  • US20250200038A1 patent drawing
  • US20250200038A1 patent drawing
  • US20250200038A1 patent drawing

AI summary

In some implementations, the techniques described herein relate to a method including: receiving, by a processor, a query from a client device; distributing, by the processor, the query to a plurality of shards; receiving, by the processor, a plurality of array provider data structures from the plurality of shards, a given array provider data structure identifying responsive identifiers from a corresponding shard; materializing, by the processor, the plurality of array provider data structures; persisting, by the processor, a portion of responsive data on disk while materializing the plurality of array provider data structures; merging, by the processor, data stored on the disk; and returning, by the processor, a result set based on the data to the client device.