Memory-Aware Hash-Join Broadcast Selection in Query Pipelines

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database systems face challenges in efficiently managing join operations, particularly in determining the optimal hash-join broadcast strategy to avoid memory overflow errors in large join trees, leading to suboptimal performance and resource utilization.

Innovation Solution

A join processing manager (JPM) is introduced to make holistic hash-join broadcast decisions by considering the global memory consumption of all joins in a pipeline, using a broadcast decision operator to determine whether to apply broadcast or hash-hash joins based on memory thresholds, thereby optimizing data distribution strategies.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If broadcast join strategy is applied to all joins in a pipeline, then join processing speed is improved, but memory consumption increases leading to out-of-memory errors

Engineering Contradiction:
Improvejoin processing speedVSAvoidmemory consumption
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The system dynamically selects between broadcast join and hash-hash join strategies based on real-time memory conditions and join characteristics. The join processing manager evaluates memory consumption thresholds and adjusts the data distribution strategy accordingly, making the system adaptive rather than static in its approach to join processing.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The invention changes the parameter of data distribution strategy from a fixed broadcast approach to a variable approach that selects between broadcast and hash-hash methods. This parameter change allows the system to optimize for either speed or memory usage depending on the specific join scenario and available resources.

Inventive Principle:
Principle #35Parameter changes

2Quantity of substance

If hash-hash join strategy is applied to all joins, then memory consumption is reduced, but join processing efficiency deteriorates

Engineering Contradiction:
Improvememory consumptionVSAvoidjoin processing efficiency
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The system dynamically switches between hash-hash join and broadcast join based on memory conditions. When memory consumption is below thresholds, the system transitions to broadcast join for improved efficiency, maximizing resource utilization without risking out-of-memory errors.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The data distribution strategy parameter is changed from a fixed hash-hash approach to a variable approach that can select between hash-hash and broadcast methods, allowing optimization of processing efficiency when memory conditions permit.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If individual join decisions are made without considering global memory consumption, then local join performance is optimized, but overall system reliability decreases due to out-of-memory errors

Engineering Contradiction:
Improvelocal join performanceVSAvoidsystem reliability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The join processing manager serves multiple functions: it evaluates memory conditions, selects data distribution strategies, and coordinates across multiple joins in a pipeline. This universal manager ensures that individual join optimizations do not compromise overall system reliability by considering the global memory context.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The system implements feedback mechanisms where memory consumption is continuously monitored and used to adjust join strategies. The join processing manager receives feedback on memory usage and adjusts the data distribution approach to prevent out-of-memory errors while maintaining optimal performance.

Inventive Principle:
Principle #23Feedback

4Productivity

If broadcast join is used for large join trees, then query execution speed is improved, but the risk of out-of-memory errors increases

Engineering Contradiction:
Improvequery execution speedVSAvoidout-of-memory error risk
Core Design Contradiction:
ProductivityVSObject-affected harmful factors

Solution Approach 1:

The system takes preliminary action by evaluating memory conditions before executing joins and selecting appropriate strategies. The join processing manager anticipates potential out-of-memory errors by assessing the join tree characteristics and memory availability, preventing errors before they occur rather than reacting to them.

Inventive Principle:
Principle #9Preliminary anti-action

Solution Approach 2:

The data distribution strategy is made dynamic to adapt to the specific characteristics of the join tree and available memory. For large join trees with sufficient memory, broadcast join is used for speed; when memory is constrained, hash-hash join is selected to prevent errors, making the system resilient to varying conditions.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20250298797A1HASH-join broadcast decision making in database systems
Publication Date: 2025.09.25 SNOWFLAKE INC
  • US20250298797A1 patent drawing
  • US20250298797A1 patent drawing
  • US20250298797A1 patent drawing

AI summary

Provided herein are systems and methods for hash-join broadcast decision making. For example, a method includes generating a query plan for a received query. The query plan includes a plurality of join operations with a plurality of hash-join-build (HJB) operations and a plurality of hash-join-probe (HJP) operations. A decision node of a plurality of decision nodes of the query plan is configured as a primary decision node. Build-side data information associated with build-side data and received from the plurality of HJB operations is decoded by the primary decision node. A data distribution method is determined by the primary decision node for each HJB operation of the plurality of HJB operations based on the build-side data information. The query plan is executed based on distributing the build-side data to the plurality of HJP operations using the data distribution method for each HJB operation of the plurality of HJB operations.