Global Request Cache for Database Query Plan Sharing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In distributed database systems, each parsing engine maintains a local request cache, preventing other engines from reusing cached query plans, leading to unnecessary parsing of repeated requests across multiple processing units.
Innovation Solution
Implementing a partitioned global request cache that distributes local request caches among processing nodes using hashing techniques, allowing query plans to be shared across parsing engines, thus eliminating redundant parsing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If local request caches are maintained for each parsing engine, then parsing performance is improved by avoiding repeated parsing of the same request, but query plan sharing between multiple parsing engines is prevented
Solution Approach 1:
The patent merges multiple local request caches into a single shared request cache structure that is accessible by all parsing engines. This is achieved by implementing a global cache with a hashing mechanism that directs queries to the appropriate cache segment, allowing query plans to be shared across all parsing engines in the system.
Solution Approach 2:
The shared request cache serves multiple parsing engines simultaneously, making the cache system universal rather than private to individual engines. The cache structure is designed to handle queries from any parsing engine and provide cached query plans to any engine that needs them, enhancing the versatility of the system.
2Device complexity
If request caches are local to each processing engine, then cache management is simplified, but redundant parsing occurs when the same request is received by multiple parsing engines
Solution Approach 1:
The shared request cache is segmented into multiple cache segments using a hashing function. Each cache segment is associated with a specific hash value range, and parsing engines use the hash of the query to determine which segment to access. This segmentation allows the system to maintain simplicity in cache management while enabling sharing across multiple engines.
Solution Approach 2:
The patent introduces a hashing function as an intermediary mechanism that mediates between parsing engines and the request cache. The hash function determines which cache segment a query should access, enabling efficient distribution and retrieval of query plans across multiple parsing engines without requiring complex direct communication protocols.
3Productivity
If a shared request cache is implemented across all parsing engines, then query plan sharing is enabled and redundant parsing is eliminated, but cache access overhead and hashing computations increase
Solution Approach 1:
Instead of implementing a fully centralized cache that requires coordination across all parsing engines, the system uses a partial sharing approach where each parsing engine maintains access to a shared cache segment determined by hashing. This partial action approach reduces the overhead of full synchronization while still enabling significant query plan reuse.
Data Source
AI summary
Techniques for improving the execution of database queries in a multi-processor system or distributed processing system environment are provided. In a database system including multiple parsing engines (PEs) for parsing database queries, or requests, received by the system and generating execution plans for the requests, execution plans generated for requests can be saved in a global request cache accessible to each of the parsing engines. Requests which have been parsed and cached by a PE can be retrieved for use by other PEs, thereby avoiding unnecessarily parsing the same database request in multiple PEs. The global request cache may be a distributed cache consisting of request caches local to each parsing engine, with execution plans allocated to the local request caches using hashing techniques applied to the database requests associated with the execution plans.


