US 12,001,409 B2
Merges using key range data structures
Rohit Agrawal, San Francisco, CA (US); Aditya Shetty, San Francisco, CA (US); Kaushal Mittal, Dublin, CA (US); Terry Chong, Pleasanton, CA (US); Thomas Fanghaenel, Oakland, CA (US); and Vaibhav Arora, San Francisco, CA (US)
Assigned to Salesforce, Inc., Cupertino, CA (US)
Filed by salesforce.com, inc., San Francisco, CA (US)
Filed on Dec. 22, 2022, as Appl. No. 18/145,181.
Application 18/145,181 is a continuation of application No. 17/009,605, filed on Sep. 1, 2020, granted, now 11,537,569.
Prior Publication US 2023/0141205 A1, May 11, 2023
Int. Cl. G06F 16/22 (2019.01); G06F 16/21 (2019.01); G06F 21/62 (2013.01)
CPC G06F 16/214 (2019.01) [G06F 16/2246 (2019.01); G06F 21/6227 (2013.01)] 16 Claims
OG exemplary drawing
 
1. A method for performing a multi-level merge operation that involves at least three levels of a log-structured merge tree (LSM tree), the method comprising:
storing, by a computer system, files across a plurality of levels included in the LSM tree, wherein a given file stores a set of records associated with a set of database keys;
determining, by the computer system, to perform the multi-level merge operation for a particular merge key range; and
performing, by the computer system, the multi-level merge operation, including:
identifying levels of the LSM tree from which to copy records that fall within the particular merge key range into a target level of the LSM tree, wherein the identifying includes assessing a number of records contributed by ones of the plurality of levels for the particular merge key range and selecting sufficient levels for the multi-level merge operation to merge at least a threshold number of records into the target level, and wherein the identified levels include the at least three levels of the LSM tree; and
copying, from the identified levels, a set of records that fall within the particular merge key range into a file at the target level.