MVCC Timestamp Garbage Collection for Database Memory Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In database management systems, the accumulation of multi-version concurrency control (MVCC) information leads to memory overhead and inefficient timestamp management, as timestamps for committed transactions become redundant once changes are visible to all read threads, necessitating a method to garbage collect these timestamps to optimize resource usage.
Innovation Solution
Implementing a garbage collection mechanism for MVCC information, where a clean-up thread identifies and removes unnecessary timestamps, replacing them with row visibility states, thereby reducing memory overhead and improving processing efficiency by eliminating redundant timestamp comparisons.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If MVCC information is maintained for all committed transactions, then concurrency control consistency is ensured, but memory overhead increases and processing efficiency decreases
Solution Approach 1:
The patent implements a garbage collection mechanism that identifies and removes MVCC timestamps that are no longer needed for concurrency control. The system determines which timestamps can be safely discarded by checking if all active read threads have completed their transactions, thereby recovering memory space while maintaining consistency for ongoing operations.
Solution Approach 2:
The patent transitions from storing complete MVCC timestamp information to using a simplified visibility state indicator. By changing the representation from detailed timestamp data to a compact visibility state, the system reduces memory overhead while preserving the essential concurrency control functionality.
2Measurement precision
If MVCC timestamps are retained for historical transactions, then transaction visibility determination is accurate, but processing efficiency decreases due to redundant comparisons
Solution Approach 1:
The patent extracts the essential visibility information from detailed MVCC timestamps and stores only the necessary visibility state. This extraction process removes redundant timestamp comparison operations while retaining the core functionality needed to determine transaction visibility, thereby improving processing efficiency without sacrificing accuracy.
Solution Approach 2:
Instead of determining visibility by comparing read thread timestamps against stored MVCC timestamps, the patent inverts the approach by pre-computing and storing the visibility state directly. This inversion eliminates the need for runtime timestamp comparisons, significantly improving processing efficiency while maintaining determination accuracy.
3Quantity of substance
If a garbage collection mechanism is implemented for MVCC timestamps, then memory overhead is reduced, but system complexity increases
Solution Approach 1:
The garbage collection mechanism is integrated into the existing transaction commit and completion processes, allowing the system to automatically identify and remove obsolete MVCC timestamps without requiring a separate complex garbage collection subsystem. The existing transaction metadata and completion tracking are leveraged to determine which timestamps can be safely removed.
Data Source
AI summary
Disclosed herein are system, method, and computer program product embodiments for performing garbage collection on a multi-version concurrency control information in the database management system. An embodiment operates by determining, using multi-version concurrency control (MVCC) information, when a row manipulated by a write transaction is visible to a plurality of readers accessing a table that includes the row. The MVCC information for the row includes at least a creation timestamp, a destruction timestamp and a row state. Once the row is visible to the plurality of readers, garbage collecting at least the creation timestamp or the destruction timestamp in the MVCC information. After the creation timestamp or destruction timestamp have been garbage collected, the plurality of readers use the row state to determine accessibility of the row in the table.


