| CPC G06F 16/144 (2019.01) [G06F 7/24 (2013.01); G06F 16/137 (2019.01); G06F 16/152 (2019.01); G06F 16/156 (2019.01); G06F 16/162 (2019.01); G06F 16/1734 (2019.01)] | 17 Claims |

|
1. A method comprising:
receiving, by a processing device, a request to perform a cursor operation to search for one or more data elements of a key-value data store, the request comprising a key identifier associated with the one or more data elements, and wherein the key-value data store comprises a tree structure with a plurality of nodes; and
in response to receiving the request to perform the cursor operation, executing, by the processing device, a prefix probe operation for the key-value data store, wherein executing the prefix probe operation comprises:
traversing, by the processing device, a portion of the plurality of nodes to identify data elements in the key-value data store that match the key identifier;
determining, by the processing device, a total number of the data elements that match the key identifier, wherein the total number of data elements that match the key identifier is tracked using a counter, and wherein the counter is incremented in response to identifying a data element that (i) matches the key identifier, (ii) is not associated with a previously encountered data element that was deleted, and (iii) is not a duplicate of a previously encountered data element;
determining, by the processing device, whether the total number of data elements that match the key identifier is greater than or equal to a threshold number;
responsive to determining that the total number of data elements that match the key identifier is greater than or equal to the threshold number, performing, by the processing device, the cursor operation and an associated merge sort operation to generate a sorted result set for the data elements that match the key identifier across the key-value data store, wherein the sorted result set excludes any data elements that match the key identifier but that are associated with the previously encountered data element that was deleted and providing, by the processing device, the sorted result set as a response to the request; and
responsive to determining that the total number of data elements that match the key identifier is not greater than or equal to the threshold number, providing, by the processing device, the response to the request without performing the cursor operation and the associated merge sort operation for the data elements that match the key identifier.
|