Hash Join Execution with Dynamic Partition Sizing and Cache Spillover

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database servers face inefficiencies in join operations due to inaccurate table statistics, leading to partition size skew and cache misses during hash join operations, which can result in additional rounds of partitioning and increased memory access latency.

Innovation Solution

A hash table structure is generated using a build key array and a link array, with spillover arrays in lower latency memory for partitions that exceed cache limits, allowing for efficient probing and minimizing memory storage requirements, thereby maintaining cache containment and reducing cache spillover.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If partition size is determined based on inaccurate table statistics, then partitioning can be performed, but partition size skew occurs and partitions cannot fit in cache

Engineering Contradiction:
Improvejoin operation efficiencyVSAvoidpartition size accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent performs a preliminary analysis of actual data distribution during the build phase to detect partition size skew before the probe phase begins. This early detection allows the system to identify problematic partitions and apply corrective measures (such as repartitioning or spill-to-disk) before cache misses occur during probing, thereby maintaining join operation efficiency despite inaccurate initial statistics

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent dynamically adjusts partitioning parameters based on observed data characteristics. When partition size skew is detected, the system modifies the partitioning strategy (e.g., changing hash functions, adjusting partition counts, or implementing uneven partitioning) to ensure partitions fit within cache boundaries, thus resolving the contradiction between productivity and reliability

Inventive Principle:
Principle #35Parameter changes

2Speed

If partition size is increased to reduce number of partitions, then processing speed improves, but cache containment is violated and cache misses increase

Engineering Contradiction:
Improveprocessing speedVSAvoidcache memory usage
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent implements dynamic partition sizing where partition boundaries are adjusted based on actual data distribution and cache capacity. During the build phase, the system monitors partition sizes and dynamically modifies them to ensure they fit within cache while maximizing the number of rows processed per partition. This dynamic adjustment maintains cache containment (preventing cache misses) while optimizing processing speed by minimizing the number of partitions

Inventive Principle:
Principle #15Dynamics

3Reliability

If additional partitioning rounds are performed to fix size skew, then partition fit in cache is improved, but execution time increases

Engineering Contradiction:
Improvepartition cache fitVSAvoidexecution time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts the partition size skew detection and correction logic from a separate partitioning round and integrates it into the build phase itself. By performing skew detection during row insertion into hash tables and applying corrections immediately (such as redirecting rows to appropriate partitions or spilling to disk), the system eliminates the need for additional partitioning rounds, thereby maintaining partition cache fit while avoiding execution time penalties

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS10810207B2Limited memory and statistics resilient hash join execution
Publication Date: 2020.10.20 ORACLE INT CORP
  • US10810207B2 patent drawing
  • US10810207B2 patent drawing
  • US10810207B2 patent drawing

AI summary

A processor receives a payload array and generates a hash table in a cache that includes a hash bucket array. Each hash bucket element contains an identifier that defines a location of a build key array element in the payload array. For a particular build key array element, the processor determines a hash bucket element that corresponds to the payload array. The processor copies the identifier for particular build key array element into the hash bucket element. If the cache is unable to insert additional build key array elements into the hash table in the cache, then the processor generates a second hash table for the remaining build key array elements in local volatile memory. When probing, the processor probes both hash tables in the cache and local volatile memory for identifiers in hash bucket elements that are used to locate matching build key array elements.