Partitioned Hash Table Structure for Cache Efficiency in Database Join Operations
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In-memory hash join operations in relational database systems face inefficiencies due to poor cache locality in traditional hash table structures, leading to increased CPU cache misses and processing delays.
Innovation Solution
An improved in-memory hash table structure is designed with three partitions: one for the primary index, another for remaining fixed-length columns involved in the join condition, and a third for all other columns, organized in a cache-friendly format using arrays and bitmaps to enhance data locality and support SIMD processing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If traditional hash table structures are used for in-memory hash join operations, then the implementation is simple and straightforward, but cache locality is poor leading to increased CPU cache misses and processing delays
Solution Approach 1:
The hash table structure is segmented into multiple partitions, with each partition storing a subset of hash buckets. This segmentation allows the CPU to access only relevant partitions during join operations, improving cache locality by reducing the amount of data that needs to be loaded into cache while maintaining implementation feasibility through modular design
Solution Approach 2:
The patent introduces a new dimension to the traditional hash table by organizing data in a multi-dimensional array structure with partitions and buckets. This dimensional reorganization enables better spatial locality and cache utilization by grouping related data elements closer together in memory, thereby reducing cache misses without significantly complicating the implementation
2Device complexity
If traditional hash table structures are used, then the data structure is compact and easy to manage, but data locality is poor causing frequent cache misses
Solution Approach 1:
The hash table is divided into partitions that can be independently managed and accessed. This segmentation improves data locality by ensuring that frequently accessed hash buckets are grouped together in specific partitions, reducing cache misses. The modular partition structure maintains manageable complexity through clear separation of data organization logic
Solution Approach 2:
Different partitions of the hash table are optimized for specific access patterns and data types. By applying local quality optimization, each partition can be tailored to store particular kinds of data or access patterns, improving overall cache efficiency without requiring complete restructuring of the entire data structure
3Device complexity
If conventional hash join processing is used, then the processing logic is straightforward, but join condition evaluation is performed row-by-row reducing efficiency
Solution Approach 1:
Multiple join condition evaluations are merged into a single batch operation by loading entire partitions into cache and evaluating all join conditions for that partition in one go. This merging approach significantly improves throughput by reducing the overhead of repeated cache accesses while keeping processing logic manageable through systematic batch processing
Data Source
AI summary
An improved hash table structure compatible with in-memory processing for increasing cache efficiency during hash join processing of a small and large table in a relational database system. The hash table, residing in processor memory, includes a first partition containing a join condition column providing best selectivity for joining the small table with the large table, at least one additional partition containing additional join condition columns for joining the small table with the large table; and an array of hash values, the array of hash values providing an index into the hash table partitions.


