US 12,487,979 B2
Subrange truncation of records
Vaibhav Arora, San Francisco, CA (US); Christopher Drexelius, San Jose, CA (US); Terry Chong, Pleasanton, CA (US); and Thomas Fanghaenel, Oakland, CA (US)
Assigned to Salesforce, Inc., San Francisco, CA (US)
Filed by Salesforce, Inc., San Francisco, CA (US)
Filed on May 4, 2023, as Appl. No. 18/312,351.
Prior Publication US 2024/0370422 A1, Nov. 7, 2024
Int. Cl. G06F 16/22 (2019.01); G06F 16/2455 (2019.01)
CPC G06F 16/2246 (2019.01) [G06F 16/2282 (2019.01); G06F 16/24552 (2019.01)] 18 Claims
OG exemplary drawing
 
11. A non-transitory computer-readable medium having program instructions stored thereon that are capable of causing a computer system to perform operations comprising:
receiving a request to truncate a subrange of records, wherein the subrange of records is stored in physical storage, and wherein the request specifies a conditional expression that is usable to identify the subrange from other subranges of records of a database table;
before truncating the subrange, determining whether the subrange is capable of being truncated with a single-record subrange truncate operation, regardless of a size of the subrange, based on whether the conditional expression satisfies a set of preconditions, and wherein the subrange includes more than one record; and
based on determining that the conditional expression satisfies the set of preconditions, performing the single-record subrange truncate operation that includes generating a single truncate record that causes the subrange of records to be truncated from the database table such that:
subsequent queries to the single-record subrange truncate operation cannot access the subrange of records; and
the subrange of records is marked for subsequent purging from the physical storage; and
based on determining that the conditional expression does not satisfy the set of preconditions, generating a truncate record for each record included in the subrange of records that causes that record to be truncated from the database table.