Key-Ordered Hash Tables for Database Query Cache Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database query performance is adversely affected by high cache miss rates due to inefficient data storage and retrieval in hash tables, leading to suboptimal processing efficiency.

Innovation Solution

Implementing a hash table system that reorders records to match the order of keys and uses a multimap data structure to efficiently store and retrieve data values, optimizing cache hits and reducing cache misses.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If data is stored in a hash table without reordering records, then the hash table can be implemented simply, but cache miss rates increase and query performance deteriorates

Engineering Contradiction:
Improvequery performanceVSAvoiddata storage structure
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies preliminary action by sorting records according to their key values before processing queries. The records are pre-sorted in ascending order of keys, which enables sequential access patterns during query processing. This preliminary sorting operation prepares the data structure in advance to match the access patterns required by hash table lookups, thereby reducing cache misses and improving query performance without requiring complex dynamic reordering during query execution.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If records are accessed randomly in hash table, then insertion is simple, but cache hit rates decrease and processing efficiency worsens

Engineering Contradiction:
Improveprocessing efficiencyVSAvoidcache misses
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The patent applies local quality by organizing records in a specific local order (sorted by key values) within the hash table structure. This creates a localized pattern where records with similar key values are stored adjacent to each other. During query processing, this local ordering enables sequential or near-sequential access patterns, which significantly improve cache hit rates and processing efficiency compared to random access patterns.

Inventive Principle:
Principle #3Local quality

3Productivity

If hash table keys are stored in arbitrary order, then storage is straightforward, but memory access operations increase and performance decreases

Engineering Contradiction:
Improvedata retrieval speedVSAvoidmemory access time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-sorting all records in the hash table according to their key values before query processing begins. This preliminary sorting operation reorganizes the data structure in advance to match the access patterns required during query execution. As a result, memory access operations proceed sequentially through the sorted records, dramatically reducing memory access time and improving data retrieval speed compared to arbitrary ordering.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12411829B2Efficient hash table based processing of database queries
Publication Date: 2025.09.09 REDPANDA DATA INC
  • US12411829B2 patent drawing
  • US12411829B2 patent drawing
  • US12411829B2 patent drawing

AI summary

A database system uses a hash table for processing database queries. The system stores keys mapped to data values in the hash table. For processing a set of records using the hash table, the system partially sorts the records to match the order of keys of the hash table. The partial storing of the records results in improving the performance of a cache storing the hash table. The hash table may be a multimap that maps a key to multiple data values. The system stores data values mapped to a key in a vector that stores all data values mapped to the key in contiguous memory. The system stores a pointer to the vector in association with the key in the multimap. The system optimizes the multimap to store the data value instead of the pointer if there is a single data value associated with a key.