IP Library Granted Patent US 10,733,148
Granted Patent B2
US 10,733,148 · App. 15/452,390 · Granted Aug 4, 2020

Predicate based data deletion

Inventor: Lars Hofhansl (Orinda, CA)
Assignee: salesforce.com, inc.
G06F16/1744G06F16/162G06F16/21
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,733,148
App. No.
15/452,390
Granted
Aug 4, 2020
Kind
B2
Abstract

A database may delete rows of data based on one or more predicate parameters. A method of data storage includes receiving a delete request for a database, where the delete request includes one or more predicate parameters and adding the predicate parameters to a set of deletion predicate parameters in metadata of the database. The method may further include performing a compaction of the database, where the compaction includes rewriting each data element of the database unless a key of the data element corresponds to at least one of the set of deletion predicate parameters.

Claims (55)

1. A method for data storage, comprising:

receiving a delete request for a database, wherein the delete request comprises a predicate parameter corresponding to a plurality of data rows in the database;

adding the predicate parameter to a set of deletion predicate parameters stored at the database as metadata;

performing a compaction of the database based at least in part on the set of deletion predicate parameters stored at the database as metadata, the compaction comprising:

identifying that each data row of the plurality of data rows comprise a key associated with a common predicate parameter, wherein the key of each data row is associated with the common predicate parameter at the time each data row is initially written to the database;

determining that the common predicate parameter is included in the set of deletion predicate parameters stored at the database as metadata; and

rewriting each data row of the remaining data rows of the database based at least in part on the determining; and

overwriting each data row of the plurality of data rows comprising the key associated with the common predicate parameter during the compaction, following the compaction, or a combination thereof.

2. The method of claim 1 , wherein the compaction comprises rewriting each data row of the database unless the key of the data row corresponds to at least one of the set of deletion predicate parameters, unless the data row is marked with a delete marker, or unless a threshold time indicated by a time-to-live (TTL) value has passed since a timestamp of the data row.

3. The method of claim 1 , further comprising:

receiving a subsequent delete request for the database, wherein the subsequent delete request comprises an identifier for a data row; and

writing a delete marker for the subsequent delete request in line with the data row associated with the identifier.

4. The method of claim 3 , further comprising:

refraining from writing a delete marker for the delete request based at least in part on the delete request comprising the predicate parameter.

5. The method of claim 1 , further comprising:

receiving a subsequent delete request for the database, wherein the subsequent delete request comprises a TTL value.

6. The method of claim 1 , wherein the respective predicate parameter corresponds to the data row in the database at the time the data row is initially written to the database.

7. The method of claim 1 , wherein the predicate parameter comprises an organization identifier, a data size identifier, a data owner identifier, a version identifier, or a combination thereof.

8. The method of claim 1 , wherein the database is structured in a log-structured merge-tree format.

9. The method of claim 1 , wherein the database comprises a write-ahead logging (WAL) database.

10. An apparatus for data storage, in a system comprising:

a processor;

memory in electronic communication with the processor; and

instructions stored in the memory and operable, when executed by the processor, to cause the apparatus to:

receive a delete request for a database, wherein the delete request comprises a predicate parameter corresponding to a plurality of data rows in the database;

add the predicate parameter to a set of deletion predicate parameters stored at the database as metadata;

perform a compaction of the database based at least in part on the set of deletion predicate parameters stored at the database as metadata, the compaction comprising:

identifying that each data row of the plurality of data rows comprise a key associated with a common predicate parameter, wherein the key of each data row is associated with the common predicate parameter at the time each data row is initially written to the database;

determining that the common predicate parameter is included in the set of deletion predicate parameters stored at the database as metadata; and

rewriting each data row of the remaining data rows of the database based at least in part on the determining; and

overwrite each data row of the plurality of data rows comprising the key associated with the common predicate parameter during the compaction, following the compaction, or a combination thereof.

11. The apparatus of claim 10 , wherein the compaction comprises rewriting each data row of the database unless the key of the data row corresponds to at least one of the set of deletion predicate parameters, unless the data row is marked with a delete marker, or unless a threshold time indicated by a time-to-live (TTL) value has passed since a timestamp of the data row.

12. The apparatus of claim 10 , wherein the instructions are further executable by the processor to:

receive a subsequent delete request for the database, wherein the subsequent delete request comprises an identifier for a data row; and

write a delete marker for the subsequent delete request in line with the data row associated with the identifier.

13. The apparatus of claim 12 , wherein the instructions are further executable by the processor to:

refrain from writing a delete marker for the delete request based at least in part on the delete request comprising the predicate parameter.

14. The apparatus of claim 10 , wherein the instructions are further executable by the processor to:

receive a subsequent delete request for the database, wherein the subsequent delete request comprises a TTL value.

15. A non-transitory computer readable medium storing code for data storage, the code comprising instructions executable by a processor to:

receive a delete request for a database, wherein the delete request comprises a predicate parameter corresponding to a plurality of data rows in the database;

add the predicate parameter to a set of deletion predicate parameters stored at the database as metadata;

perform a compaction of the database based at least in part on the set of deletion predicate parameters stored at the database as metadata, the compaction comprising:

identifying that each data row of the plurality of data rows comprise a key associated with a common predicate parameter, wherein the key of each data row is associated with the common predicate parameter at the time each data row is initially written to the database;

determining that the common predicate parameter is included in the set of deletion predicate parameters stored at the database as metadata; and

rewriting each data row of the remaining data rows of the database based at least in part on the determining; and

overwrite each data row of the plurality of data rows comprising the key associated with the common predicate parameter during the compaction, following the compaction, or a combination thereof.

16. The non-transitory computer-readable medium of claim 15 , wherein the compaction comprises rewriting each data row of the database unless the key of the data row corresponds to at least one of the set of deletion predicate parameters, unless the data row is marked with a delete marker, or unless a threshold time indicated by a time-to-live (TTL) value has passed since a timestamp of the data row.

17. The non-transitory computer-readable medium of claim 15 , wherein the instructions are further executable by the processor to:

receive a subsequent delete request for the database, wherein the subsequent delete request comprises an identifier for a data row; and

write a delete marker for the subsequent delete request in line with the data row associated with the identifier.

18. The non-transitory computer-readable medium of claim 17 , wherein the instructions are further executable by the processor to:

refrain from writing a delete marker for the delete request based at least in part on the delete request comprising the predicate parameter.

19. The non-transitory computer-readable medium of claim 15 , wherein the instructions are further executable by the processor to:

receive a subsequent delete request for the database, wherein the subsequent delete request comprises a TTL value.

Assignments (2)
CHANGE OF NAME Recorded Nov 21, 2024
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 069431/0179 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 7, 2017
From: HOFHANSL, LARS
To: SALESFORCE.COM, INC.
Reel/Frame 041488/0603 →
Continuity (1)
Related Publication 20180260407A1 · Sep 13, 2018