Systems and methods for efficient bulk data deletion
Abstract
Systems and methods for efficient bulk data deletion. The system comprises: 1) a deletion record set; an in-memory database representation comprising: tables and records; one or more exclusive locks for the records; and a record block index; 2) a persistent database representation comprising: record blocks; and a transaction log. The method comprises: receiving, by a processor, a deletion record set; acquiring, by the processor, an exclusive lock for one or more records in the deletion record set; deleting, by the processor, the deletion record set from an in-memory representation of the database; generating, by the processor, one or more post-delete record block sets; updating, by the processor, an in-memory record block index; writing, by the processor, the one or more post-delete record block sets to a persistent storage representation of the database; and, adding, by the processor, a transaction log entry for the record block index update.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 17 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A computer-implemented method for bulk data deletion from a database, the method comprising: receiving, by a processor, a deletion record set for the bulk data deletion identified by executing an internal database procedure or querying an in-memory representation of the database for records that match certain conditions, wherein the bulk data deletion is performed without taking the database offline; acquiring, by the processor, an exclusive lock for one or more records in the deletion record set; deleting, by the processor, the deletion record set from the in-memory representation of the database and, to maintain referential integrity of the database, additionally deleting records that reference records in the deletion record set; generating, by the processor, one or more post-delete record block sets, wherein the one or more post delete record blocks are different from the deletion record set; updating, by the processor, an in-memory record block index, wherein the record block index
- Claim 2Depends on #1
The computer-implemented method of claim 1, wherein: updating, by the processor, the in-memory record block index, is performed in parallel with: writing, by the processor, the one or more post-delete record block sets to the persistent storage representation of the database; and adding, by the processor, the transaction log entry for the updated record block index update.
- Claim 3Depends on #1
The computer-implemented method of claim 1, wherein generating the one or more post-delete record block sets comprises: initializing, by the processor, a list of post-delete record block sets to empty; selecting, by the processor, an unprocessed table from the database; selecting, by the processor, an unprocessed version from the selected table; generating, by the processor, a post-delete record block set for the selected table and the selected version; and adding, by the processor, the post-delete record block set for the selected table, and selected version to the list of post-delete record block sets.
- Claim 4Depends on #3
The computer-implemented method of claim 3, wherein generating the post-delete record block set for the selected table and the selected version comprises: initializing, by the processor, a per-(table, version) post-delete record block set to empty; selecting, by the processor, an unprocessed record block from a pre-delete set, the unprocessed record block containing a record to be deleted; producing, by the processor, a modified copy of the record block that omits both a record id and a record body that corresponds to the record to be deleted; and adding, by the processor, the modified copy to the per (table, version) post-delete record block set.
- Claim 5Depends on #1
The computer-implemented method of claim 1, wherein updating the in-memory record block index comprises: selecting, by the processor, an unprocessed version; selecting, by the processor, an unprocessed table associated with the unprocessed version; replacing, by the processor, the record block for the selected table and the selected version with the post-delete record blocks for the selected table and the selected version.
- Claim 6Independent Claim
A system comprising: a processor; and a memory storing instructions that, when executed by the processor, configure the system to: receive, by the processor, a deletion record set for bulk data deletion identified by executing an internal database procedure or querying an in-memory representation of the database for records that match certain conditions, wherein the bulk data deletion is performed without taking the database offline; acquire, by the processor, an exclusive lock for one or more records in the deletion record set; delete, by the processor, the deletion record set from the in-memory representation of a database and, to maintain referential integrity of the database, additionally delete records that reference records in the deletion record set; generate, by the processor, one or more post-delete record block sets, wherein the one or more post delete record blocks are different from the deletion record set; update, by the processor, an in-memory record block index, wherein
- Claim 7Depends on #6
The system of claim 6, wherein the memory storing instructions that, when executed by the processor, further configure the system to: execute, by the processor, updating the in-memory record block index, in parallel with: writing the one or more post-delete record block sets to the persistent storage representation of the database; and adding the transaction log entry for the updated record block index update.
- Claim 8Depends on #6
The system of claim 6, wherein when generating the one or more post-delete record block sets, the memory storing instructions that, when executed by the processor, further configure the system to: initialize, by the processor, a list of post-delete record block sets to empty; select, by the processor, an unprocessed table from the database; select, by the processor, an unprocessed version from the selected table; generate, by the processor, a post-delete record block set for the selected table and the selected version; and add, by the processor, the post-delete record block set for the selected table, and selected version to the list of post-delete record block sets.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to U.S. Ser. No. 63/238,348 filed Aug. 30, 2021, which is hereby incorporated by reference in its entirety. BACKGROUND A query-based method of deleting a large number of records from a database temporarily increases the size of the database. This increase is proportional to the number of record versions being deleted. This increase can exceed the machine capacity when billions of records need to be deleted. Furthermore, such a method is slow because it adds more data to the database. Many alternative methods of bulk deleting records are also problematic since they require taking the database offline. BRIEF SUMMARY Disclosed herein are systems and methods that enable deletion of large numbers of records from a database quickly, without greatly increasing the size of the database, transactionally, and without taking the database offline. A system for efficient bulk data deletion can comprise: a) a deletion record set; b) an in-memory database representation, which itself may comprise: tables and records; one or more exclusive locks for the records; and a record block index; and c) a persistent database representation, which itself can comprise: record blocks; and a transaction log. The systems and methods disclosed herein do not add data to the database in order to complete the deletion, and thus do not exceed machine capacity. The systems and methods disclosed herein quickly delete bulk data; they are faster than query-based deletion since the process is batch-based and can be parallelized. The systems and methods disclosed herein delete bulk data transactionally. By making the bulk delete part of the transaction log, the database restore treats the operation as atomic. The systems and methods disclosed herein delete bulk data without taking the database offline. The bulk delete operation can by synchronized using database locks such that the operation interleaves correctly with other live datab
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (17)
| Patent | Title | Year | Citations |
|---|