Database Locking Non-Existent Index Keys via Partitioning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current database management systems face performance delays when handling transactions that request access to non-existent index keys, as existing locking mechanisms often block multiple transactions due to locking entire ranges of keys, leading to inefficiencies in concurrency and resource utilization.
Innovation Solution
Implement a k-partition function to assign non-existent index keys to specific partitions, allowing for targeted locking of only the necessary partitions, thereby reducing the number of blocked transactions and improving system performance by allowing access to other partitions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional locking mechanisms lock entire ranges of keys when a non-existent key is requested, then data consistency is maintained, but transaction concurrency is reduced and system performance deteriorates
Solution Approach 1:
The patent divides the key space into multiple partitions (e.g., using hash partitioning where key k maps to partition k mod P). When a transaction requests a non-existent key, only the specific partition containing that key is locked, rather than locking the entire key range. This segmentation allows other transactions to access different partitions simultaneously, improving concurrency while maintaining data consistency within each partition.
2Reliability
If traditional locking mechanisms lock entire ranges of keys, then data consistency is ensured, but the number of blocked transactions increases and resource utilization decreases
Solution Approach 1:
By partitioning the key space and locking only the specific partition containing the requested non-existent key, the system minimizes the scope of locked resources. This allows other transactions to utilize different partitions efficiently, reducing resource idle time and improving overall system utilization while maintaining consistency within each partition.
3Productivity
If k-partition function is used to assign non-existent keys to specific partitions, then transaction concurrency is improved and performance is enhanced, but system complexity increases
Solution Approach 1:
The patent employs a universal hash partitioning function that can be applied to any key in the index, making the locking mechanism adaptable to different key types and index structures. This multi-functional approach allows the same partitioning logic to handle various scenarios (existing keys, non-existent keys, range queries) without requiring separate complex locking strategies for each case.
Solution Approach 2:
The system changes the parameter of key representation by transforming keys through a hash function to map them to partition identifiers. This parameter transformation simplifies the locking decision process - instead of analyzing key ranges and overlaps, the system simply computes the partition number and locks that specific partition, reducing the computational complexity of lock management.
Data Source
Figure 1
Figure 2A~2C
Figure 3
AI summary
This disclosure provides systems, methods, and apparatus for managing locks for non-existent keys in an index of a database. The system can receive a first transaction for accessing a first requested key that does not match any of a plurality of keys in the index. The system partitions the first requested key using a partitioning function to a first partition. The system can also receive a second transaction for accessing a second requested key that does not match any of the plurality of keys in the index. The system also partitions the second requested key using the partitioning function to a second partition. The system assigns locks to the second transaction only if the second partition is distinct from the first partition.