Database Subrange Truncation Using Single Truncate Records
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database systems lack an efficient mechanism to truncate a portion of records from a table without impacting other records, leading to time-consuming and space-intensive per-record truncate operations, especially when dealing with large datasets.
Innovation Solution
Implement a database system that uses a single-record subrange truncate operation based on conditional expressions, ensuring preconditions are met to allow contiguous truncation, and utilizes an in-memory cache to manage truncate records before flushing them to persistent storage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If per-record truncate operations are used to remove a portion of records from a table, then the records can be truncated individually, but the operation becomes time-consuming and space-intensive when dealing with large datasets
Solution Approach 1:
The patent merges multiple per-record truncate operations into a single subrange truncate operation. Instead of processing each record individually, the system combines contiguous records into a subrange identified by a conditional expression (e.g., WHERE clause), and truncates the entire subrange with a single operation. This merging approach resolves the contradiction by maintaining the ability to truncate specific portions of records while dramatically reducing the time required compared to processing each record separately.
Solution Approach 2:
The patent segments the table records into subranges based on conditional expressions that identify contiguous portions of records. By dividing the dataset into meaningful subranges (e.g., records within a specific date range, or records matching certain criteria), the system can selectively truncate only the required portion without affecting other records. This segmentation enables precise control over which records are truncated while optimizing the operation efficiency.
2Ease of operation
If per-record truncate operations are used to remove a portion of records from a table, then the records can be truncated individually, but the operational overhead and storage requirements increase significantly
Solution Approach 1:
The patent merges multiple truncate operations into a single subrange truncate record. Instead of creating and storing individual truncate records for each record being removed, the system creates one truncate record that represents the entire subrange. This merging approach maintains the ability to truncate specific portions of records while significantly reducing the storage overhead associated with tracking each truncate operation separately.
3Productivity
If a single-record subrange truncate operation is implemented, then truncation can be performed in constant time, but preconditions must be satisfied and the mechanism is more complex
Solution Approach 1:
The patent implements preliminary validation of preconditions before executing the subrange truncate operation. The system checks whether the conditional expression satisfies required preconditions (such as whether the records form a contiguous subrange that can be efficiently truncated) before performing the truncate. This preliminary action ensures that the constant-time truncate operation can be safely executed while maintaining data integrity, and the complexity is managed through structured validation rather than ad-hoc checks.
Data Source
AI summary
Techniques are disclosed that relate to truncating a subrange of records from a database table. A computer system receives a request to truncate the subrange of records. The request specifies a conditional expression that is usable to identify the subrange from other subranges of records of the database table. Before truncating the subrange of records, the computer system determines whether the subrange of records can be truncated from the database table with a single-record subrange truncate operation, regardless of a size of the subrange of records, based on whether the conditional expression satisfies a set of preconditions. Based on determining that the conditional expression satisfies those preconditions, the computer system performs the single-record subrange truncate operation that includes generating a truncate record that causes the subrange of records to be truncated from the database table.


