Hash-Based Full Outer Join Memory Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems face inefficiencies in computing full outer joins between tables, particularly when dealing with large datasets that exceed available memory, leading to suboptimal performance and resource utilization.

Innovation Solution

The implementation of a hash-based join operation in four phases: build, hybrid, full partition join, and piece-wise partition join, which partitions rows, uses in-memory and spilled partitions, and employs hash tables to efficiently join tables based on equijoin conditions, allowing for effective handling of memory constraints and optimizing join operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional full outer join algorithms are used, then correctness of join results is maintained, but processing efficiency deteriorates and resource utilization is suboptimal when dealing with large datasets

Engineering Contradiction:
Improvejoin processing efficiencyVSAvoidresource overhead
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent divides the full outer join operation into four distinct phases: build phase, hybrid phase, full partition join phase, and piece-wise partition join phase. Each phase processes a specific subset of data with optimized algorithms, avoiding the inefficiency of applying a single algorithm to the entire dataset. The build phase creates hash tables for in-memory partitions, the hybrid phase handles joins between in-memory and spilled partitions, the full partition join phase processes spilled partitions in pairs, and the piece-wise partition join phase handles remaining unjoined rows. This segmentation allows each phase to use the most efficient processing method for its specific data characteristics.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The build phase performs preliminary actions by reading and partitioning rows from both input tables, creating hash tables for in-memory partitions before the actual join operations begin. This preliminary partitioning and hash table construction enables subsequent phases to perform joins more efficiently without reprocessing the entire data. The spilled partition identification and preparation also occur in advance, allowing the hybrid and full partition join phases to proceed without additional overhead.

Inventive Principle:
Principle #10Preliminary action

2Speed

If all data is loaded into memory for join operations, then processing speed is improved, but memory constraints are violated and system stability deteriorates

Engineering Contradiction:
Improvedata retrieval speedVSAvoidmemory constraint compliance
Core Design Contradiction:
SpeedVSStability of the object's composition

Solution Approach 1:

The patent implements a dynamic memory management strategy where the join algorithm adapts its behavior based on available memory and data size. The build phase reads data and dynamically determines which partitions can fit in memory versus which must be spilled to disk. The hybrid phase dynamically switches between in-memory hash joins and spilled partition processing. The full partition join phase dynamically pairs spilled partitions based on their sizes and compatibility. This dynamic adaptation ensures memory constraints are never violated while maintaining optimal processing speed for the available resources.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces a new dimension of storage by utilizing disk-based spilled partitions in addition to in-memory storage. This two-dimensional storage approach (memory + disk) allows the system to handle datasets larger than available memory. The build phase partitions data into in-memory and spilled components, creating a hierarchical storage structure. The hybrid phase efficiently bridges the memory and disk dimensions by joining in-memory partitions with their corresponding spilled partitions. This dimensional expansion resolves the contradiction between speed and memory constraints.

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

3Reliability

If hash tables are built for all partitions, then join accuracy is maintained, but memory usage increases and exceeds available resources

Engineering Contradiction:
Improvejoin result accuracyVSAvoidmemory consumption
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent applies local quality by building hash tables selectively rather than uniformly across all partitions. The build phase identifies which partitions can fit in memory and builds hash tables only for those in-memory partitions. The hybrid phase then builds additional hash tables only for the specific spilled partitions that need to be joined with in-memory partitions. The full partition join phase processes spilled partitions in pairs, building hash tables only for one partition in each pair. This selective, localized hash table construction maintains join accuracy where needed while minimizing overall memory consumption.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS7730055B2Efficient hash based full-outer join
Publication Date: 2010.06.01 ORACLE INT CORP
  • US7730055B2 patent drawing
  • US7730055B2 patent drawing
  • US7730055B2 patent drawing

AI summary

In a database system, a full outer join is computed using a hash-based join.