Data Dictionary Expiration Cleanup for Primary Key ID Reuse
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
As data records increase, the quantity of primary key IDs in a data dictionary increases constantly, leading to system crashes due to unendurability.
Innovation Solution
A maintenance method for a data dictionary that detects and deletes key-value pairs when their maintenance duration exceeds a predetermined threshold, recovering the primary key IDs for reuse.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If primary key IDs are continuously allocated for new data records, then data records can be uniquely identified, but the data dictionary size increases constantly leading to system crash
Solution Approach 1:
The patent implements a maintenance mechanism that identifies and deletes obsolete key-value pairs from the data dictionary based on expiration timestamps. When a key-value pair's current time exceeds its expiration time, it is removed from the dictionary and its corresponding primary key ID is recovered into a reusable pool, thereby preventing unbounded growth of the data dictionary while maintaining system reliability
Solution Approach 2:
The patent transforms the static data dictionary into a dynamic structure with automatic maintenance capabilities. By introducing expiration timestamps and implementing periodic cleanup operations, the system adapts to changing data access patterns, actively managing dictionary size to prevent system crashes while preserving necessary mappings
2Speed
If all primary key mappings are maintained in the data dictionary, then fast lookup is achieved, but memory resources are exhausted causing system crash
Solution Approach 1:
The patent implements automatic deletion of expired key-value pairs from the data dictionary by comparing current time with expiration timestamps. This reduces memory consumption by removing obsolete entries while preserving active mappings necessary for fast lookup, thereby resolving the contradiction between lookup speed and memory usage
Solution Approach 2:
The patent introduces periodic maintenance operations that scan the data dictionary for expired entries and remove them. This periodic cleanup mechanism ensures that the data dictionary size remains manageable while preserving lookup performance for active records, preventing memory exhaustion
Data Source
Figure 1~2
Figure 3~4
Figure 5~6
AI summary
One or more embodiments of this specification provide a maintenance method and apparatus for a data dictionary. The data dictionary maintains a key-value pair corresponding to a primary key included in a data record stored in a database; and a key of the key-value pair includes the primary key included in the data record, a value of the key-value pair includes a primary key ID obtained by mapping the primary key included in the data record, and the method includes: obtaining maintenance duration of the key-value pair; determining whether the maintenance duration reaches a predetermined duration threshold; and if yes, deleting the key-value pair, and writing the primary key ID into a list of IDs to be allocated.