Physical storage devices are ubiquitous today. They are used to store and/or retrieve data for many different purposes. However, managing such physical storage devices is becoming increasingly difficult as the amount of stored data becomes larger. Accordingly, there is a need to improve database management.
Current techniques for managing databases are generally ineffective and/or inefficient. For example, some current techniques for managing databases use a binary search to identify where data is located. Such techniques require use the binary search over the entire search space and require multiple accesses of memory for the binary search that return large amounts of data in each step of the binary search that is not relevant to the next step of the binary search. For another example, some current techniques for storing data in a physical storage device ignore underlying address spaces and/or use rigid data structures. Such techniques can result in the misuse of address spaces and/or require frequent refactoring.
This disclosure provides more effective and/or efficient techniques for managing databases. Such techniques are described with respect to reading and writing data in a physical storage device. However, it should be recognized that other contexts can be used with techniques described herein. For example, data other than addresses for a physical storage device can use techniques described herein. In addition, some techniques optionally complement or replace other techniques for managing databases.
Some techniques are described herein for iteratively searching a search space while prefetching data needed for subsequent searches. Such techniques can be tree-based and use a different binary search for each iteration. In addition, some techniques are described herein using a data structure that includes void elements for reserving space in the data structure for new storage updates (e.g., update requests to add new and/or different data to the data structure). Such techniques can automatically add additional void elements while a computer system is idle and/or stop adding the additional void elements after a predetermined time has passed. In addition, such techniques can tailor the number of void elements for different areas of the data structure based on previous and/or predicted use.
In some examples, a method that is performed by a computer system is described. In some examples, the method comprises: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a non-transitory computer-readable storage medium storing one or more programs configured to be executed by one or more processors of a computer system is described. In some examples, the one or more programs includes instructions for: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a transitory computer-readable storage medium storing one or more programs configured to be executed by one or more processors of a computer system is described. In some examples, the one or more programs includes instructions for: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a computer system comprising one or more processors and memory storing one or more program configured to be executed by the one or more processors is described. In some examples, the one or more programs includes instructions for: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a computer system is comprising means for performing each of the following steps: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a computer program product is described. In some examples, the computer program product comprises one or more programs configured to be executed by one or more processors of a computer system. In some examples, the one or more programs include instructions for: receiving a search query; identifying a search space that is divided into a first number of portions; performing, based on the search query, a first search of the first number of portions to identify a first portion; in response to performing the first search, prefetching a second number of portions corresponding to the first portion; performing, based on the search query, a second search of the second number of portions to identify a second portion, wherein the second search is different from the first search; and after performing the second search, performing a third search to identify a search result corresponding to the search query, wherein the third search is different from the second search.
In some examples, a method that is performed by a computer system is described. In some examples, the method comprises: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
In some examples, a non-transitory computer-readable storage medium storing one or more programs configured to be executed by one or more processors of a computer system is described. In some examples, the one or more programs includes instructions for: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
In some examples, a transitory computer-readable storage medium storing one or more programs configured to be executed by one or more processors of a computer system is described. In some examples, the one or more programs includes instructions for: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
In some examples, a computer system comprising one or more processors and memory storing one or more program configured to be executed by the one or more processors is described. In some examples, the one or more programs includes instructions for: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
In some examples, a computer system is comprising means for performing each of the following steps: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
In some examples, a computer program product is described. In some examples, the computer program product comprises one or more programs configured to be executed by one or more processors of a computer system. In some examples, the one or more programs include instructions for: receiving a request to add first data to memory; and in response to receiving the request to add the first data to the memory: identifying a first node in a tree structure; identifying a first location within the first node; shifting second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location; and adding the first data to the first location.
Executable instructions for performing these functions are, optionally, included in a non-transitory computer-readable storage medium or other computer program product configured for execution by one or more processors. Executable instructions for performing these functions are, optionally, included in a transitory computer-readable storage medium or other computer program product configured for execution by one or more processors.
For a better understanding of the various described embodiments, reference should be made to the Detailed Description below, in conjunction with the following drawings in which like reference numerals refer to corresponding parts throughout the figures.
The following description sets forth exemplary methods, parameters, and the like. It should be recognized, however, that such description is not intended as a limitation on the scope of the present disclosure but is instead provided as a description of exemplary embodiments.
Methods and/or processes described herein can include one or more steps that are contingent upon one or more conditions being satisfied. It should be understood that a method can occur over multiple iterations of the same process with different steps of the method being satisfied in different iterations. For example, if a method requires performing a first step upon a determination that a set of one or more criteria is met and a second step upon a determination that the set of one or more criteria is not met, a person of ordinary skill in the art would appreciate that the steps of the method are repeated until both conditions, in no particular order, are satisfied. Thus, a method described with steps that are contingent upon a condition being satisfied can be rewritten as a method that is repeated until each of the conditions described in the method are satisfied. This, however, is not required of system or computer readable medium claims where the system or computer readable medium claims include instructions for performing one or more steps that are contingent upon one or more conditions being satisfied. Because the instructions for the system or computer readable medium claims are stored in one or more processors and/or at one or more memory locations, the system or computer readable medium claims include logic that can determine whether the one or more conditions have been satisfied without explicitly repeating steps of a method until all of the conditions upon which steps in the method are contingent have been satisfied. A person having ordinary skill in the art would also understand that, similar to a method with contingent steps, a system or computer readable storage medium can repeat the steps of a method as many times as needed to ensure that all of the contingent steps have been performed.
Although the following description uses terms “first,” “second,” etc. to describe various elements, these elements should not be limited by the terms. In some examples, these terms are used to distinguish one element from another. For example, a first subsystem could be termed a second subsystem, and, similarly, a subsystem device could be termed a subsystem device, without departing from the scope of the various described embodiments. In some examples, the first subsystem and the second subsystem are two separate references to the same subsystem. In some embodiments, the first subsystem and the second subsystem are both subsystem, but they are not the same subsystem or the same type of subsystem.
The terminology used in the description of the various described embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the description of the various described embodiments and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and/or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “includes,” “including,” “comprises,” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The term “if” is, optionally, construed to mean “when,” “upon,” “in response to determining,” “in response to detecting,” or “in accordance with a determination that” depending on the context. Similarly, the phrase “if it is determined” or “if [a stated condition or event] is detected” is, optionally, construed to mean “upon determining,” “in response to determining,” “upon detecting [the stated condition or event],” “in response to detecting [the stated condition or event],” or “in accordance with a determination that [the stated condition or event]” depending on the context.
Turning to
In the illustrated example, compute system 100 includes processor subsystem 110 communicating with (e.g., wired or wirelessly) memory 120 (e.g., a system memory) and I/O interface 130 via interconnect 150 (e.g., a system bus, one or more memory locations, or other communication channel for connecting multiple components of compute system 100). In addition, I/O interface 130 is communicating with (e.g., wired or wirelessly) to I/O device 140. In some examples, I/O interface 130 is included with I/O device 140 such that the two are a single component. It should be recognized that there can be one or more I/O interfaces, with each I/O interface communicating with one or more I/O devices. In some examples, multiple instances of processor subsystem 110 can be communicating via interconnect 150.
Compute system 100 can be any of various types of devices, including, but not limited to, a system on a chip, a server system, a personal computer system (e.g., a smartphone, a smartwatch, a wearable device, a tablet, a laptop computer, and/or a desktop computer), a sensor, or the like. In some examples, compute system 100 is included or communicating with a physical component for the purpose of modifying the physical component in response to an instruction. In some examples, compute system 100 receives an instruction to modify a physical component and, in response to the instruction, causes the physical component to be modified. In some examples, the physical component is modified via an actuator, an electric signal, and/or algorithm. Examples of such physical components include an acceleration control, a break, a gear box, a hinge, a motor, a pump, a refrigeration system, a spring, a suspension system, a steering control, a pump, a vacuum system, and/or a valve. In some examples, a sensor includes one or more hardware components that detect information about a physical environment in proximity to (e.g., surrounding) the sensor. In some examples, a hardware component of a sensor includes a sensing component (e.g., an image sensor or temperature sensor), a transmitting component (e.g., a laser or radio transmitter), a receiving component (e.g., a laser or radio receiver), or any combination thereof. Examples of sensors include an angle sensor, a chemical sensor, a brake pressure sensor, a contact sensor, a non-contact sensor, an electrical sensor, a flow sensor, a force sensor, a gas sensor, a humidity sensor, an image sensor (e.g., a camera sensor, a radar sensor, and/or a LiDAR sensor), an inertial measurement unit, a leak sensor, a level sensor, a light detection and ranging system, a metal sensor, a motion sensor, a particle sensor, a photoelectric sensor, a position sensor (e.g., a global positioning system), a precipitation sensor, a pressure sensor, a proximity sensor, a radio detection and ranging system, a radiation sensor, a speed sensor (e.g., measures the speed of an object), a temperature sensor, a time-of-flight sensor, a torque sensor, and an ultrasonic sensor. In some examples, a sensor includes a combination of multiple sensors. In some examples, sensor data is captured by fusing data from one sensor with data from one or more other sensors. Although a single compute system is shown in
In some examples, processor subsystem 110 includes one or more processors or processing units configured to execute program instructions to perform functionality described herein. For example, processor subsystem 110 can execute an operating system, a middleware system, one or more applications, or any combination thereof.
In some examples, the operating system manages resources of compute system 100. Examples of types of operating systems covered herein include batch operating systems (e.g., Multiple Virtual Storage (MVS)), time-sharing operating systems (e.g., Unix), distributed operating systems (e.g., Advanced Interactive eXecutive (AIX), network operating systems (e.g., Microsoft Windows Server), and real-time operating systems (e.g., QNX). In some examples, the operating system includes various procedures, sets of instructions, software components, and/or drivers for controlling and managing general system tasks (e.g., memory management, storage device control, power management, or the like) and for facilitating communication between various hardware and software components. In some examples, the operating system uses a priority-based scheduler that assigns a priority to different tasks that processor subsystem 110 can execute. In such examples, the priority assigned to a task is used to identify a next task to execute. In some examples, the priority-based scheduler identifies a next task to execute when a previous task finishes executing. In some examples, the highest priority task runs to completion unless another higher priority task is made ready.
In some examples, the middleware system provides one or more services and/or capabilities to applications (e.g., the one or more applications running on processor subsystem 110) outside of what the operating system offers (e.g., data management, application services, messaging, authentication, API management, or the like). In some examples, the middleware system is designed for a heterogeneous computer cluster to provide hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, package management, or any combination thereof. Examples of middleware systems include Lightweight Communications and Marshalling (LCM), PX4, Robot Operating System (ROS), and ZeroMQ. In some examples, the middleware system represents processes and/or operations using a graph architecture, where processing takes place in nodes that can receive, post, and multiplex sensor data messages, control messages, state messages, planning messages, actuator messages, and other messages. In such examples, the graph architecture can define an application (e.g., an application executing on processor subsystem 110 as described above) such that different operations of the application are included with different nodes in the graph architecture.
In some examples, a message sent from a first node in a graph architecture to a second node in the graph architecture is performed using a publish-subscribe model, where the first node publishes data on a channel in which the second node can subscribe. In such examples, the first node can store data in memory (e.g., memory 120 or some local memory of processor subsystem 110) and notify the second node that the data has been stored in the memory. In some examples, the first node notifies the second node that the data has been stored in the memory by sending a pointer (e.g., a memory pointer, such as an identification of a memory location) to the second node so that the second node can access the data from where the first node stored the data. In some examples, the first node would send the data directly to the second node so that the second node would not need to access a memory based on data received from the first node.
Memory 120 can include a computer readable medium (e.g., non-transitory or transitory computer readable medium) usable to store (e.g., configured to store, assigned to store, and/or that stores) program instructions executable by processor subsystem 110 to cause compute system 100 to perform various operations described herein. For example, memory 120 can store program instructions to implement the functionality associated with methods 900 and 1400 described below.
Memory 120 can be implemented using different physical, non-transitory memory media, such as hard disk storage, floppy disk storage, removable disk storage, flash memory, random access memory (RAM-SRAM, EDO RAM, SDRAM, DDR SDRAM, RAMBUS RAM, or the like), read only memory (PROM, EEPROM, or the like), or the like. Memory in compute system 100 is not limited to primary storage, such as memory 120. Compute system 100 can also include other forms of storage, such as cache memory in processor subsystem 110 and secondary storage on I/O device 140 (e.g., a hard drive, storage array, etc.). In some examples, these other forms of storage can also store program instructions executable by processor subsystem 110 to perform operations described herein. In some examples, processor subsystem 110 (or each processor within processor subsystem 110) contains a cache or other form of on-board memory.
I/O interface 130 can be any of various types of interfaces configured to communicate with other devices. In some examples, I/O interface 130 includes a bridge chip (e.g., Southbridge) from a front-side bus to one or more back-side buses. I/O interface 130 can communicate with one or more I/O devices (e.g., I/O device 140) via one or more corresponding buses or other interfaces. Examples of I/O devices include storage devices (hard drive, optical drive, removable flash drive, storage array, SAN, or their associated controller), network interface devices (e.g., to a local or wide-area network), sensor devices (e.g., camera, radar, LiDAR, ultrasonic sensor, GPS, inertial measurement device, or the like), and auditory or visual output devices (e.g., speaker, light, screen, projector, or the like). In some examples, compute system 100 is communicating with a network via a network interface device (e.g., configured to communicate over Wi-Fi, Bluetooth, Ethernet, or the like). In some examples, compute system 100 is directly or wired to the network.
In some examples, some subsystems are not connected to other subsystem (e.g., first subsystem 210 can be connected to second subsystem 220 and third subsystem 230 but second subsystem 220 cannot be connected to third subsystem 230). In some examples, some subsystems are connected via one or more wires while other subsystems are wirelessly connected. In some examples, messages are set between the first subsystem 210, second subsystem 220, and third subsystem 230, such that when a respective subsystem sends a message the other subsystems receive the message (e.g., via a wire and/or a bus). In some examples, one or more subsystems are wirelessly connected to one or more compute systems outside of device 200, such as a server system. In such examples, the subsystem can be configured to communicate wirelessly to the one or more compute systems outside of device 200.
In some examples, device 200 includes a housing that fully or partially encloses subsystems 210-230. Examples of device 200 include a home-appliance device (e.g., a refrigerator or an air conditioning system), a robot (e.g., a robotic arm or a robotic vacuum), and a vehicle. In some examples, device 200 is configured to navigate (with or without user input) in a physical environment.
In some examples, one or more subsystems of device 200 are used to control, manage, and/or receive data from one or more other subsystems of device 200 and/or one or more compute systems remote from device 200. For example, first subsystem 210 and second subsystem 220 can each be a camera that captures images, and third subsystem 230 can use the captured images for decision making. In some examples, at least a portion of device 200 functions as a distributed compute system. For example, a task can be split into different portions, where a first portion is executed by first subsystem 210 and a second portion is executed by second subsystem 220.
In some examples, database 300 is a data structure (e.g., an associative array) used to obtain data stored in a physical storage device, such as a hard-disk drive or a solid-state drive. For example, the physical storage device can be divided into physical blocks of memory, and each block of memory can be assigned a physical block address (PBA). In such an example, a PBA is mapped to a logical block address (LBA) that is used by a computer system to identify the PBA (e.g., a location of data). In some examples, a key or a value of database 300 includes an LBA. For example, a key of database 300 can include an indication of data stored at a particular PBA, and a value of database 300 corresponding the key includes a LBA for retrieving the data. The data stored at the PBA can be any type of data, including a string, binary data, multimedia data, and/or another type of data.
As mentioned above, the key-value pair configuration of database 300 has a respective key stored adjacent to a respective value corresponding to the respective key. That is, each key is stored adjacent to a value corresponding to the key instead of another key. Such an organization is an example of the keys and values not being continuous. As a result of this configuration, retrieval of an amount of continuous data (e.g., one or more cache lines) in database 300 results in retrieval of a set of keys and a set of values corresponding to the set of keys, returning less keys for the same amount of memory than if the values were not stored adjacent to the keys.
Using the key-value pair configuration of database 400, a computer system can perform an unpredictable memory fetch and fetch one or more cache lines concurrently using a processor prefetch model. Each of the fetched cache lines can include keys of a key-value pair (e.g., without including corresponding values). Once a desired key is found, a corresponding value can be accessed. In some examples, concurrently fetching cache lines improves the overall latency of a search, as the computer system receives each cache line simultaneously and/or concurrently instead of needing to perform the retrievals iteratively. Additionally, the computer system does not need to search across values as, in some examples, required using database 300 of
Attention is now directed towards techniques for searching databases. Such techniques are described with respect to reading data from a physical storage device. However, it should be recognized that other contexts can be used with techniques described herein. For example, a data structure storing data other than LBAs and/or PBAs can use techniques described herein. In addition, some techniques optionally complement or replace other techniques for searching databases.
In some examples, a database (e.g., database 300 of
Using the formula, the number [0 . . . 64] corresponds to the number of nodes on a level of the tree and can change based on a number of branch and/or leaf nodes for a current level.
Referring to
In some examples, an element of a node of tree 700 includes a key and/or a value. For example, each element of a root and/or branch node of tree 700 can include a first subset of bits (e.g., Key H 712, including a number of more significant bits (e.g., most significant bits), such as 1-5) and/or a second subset of bits (e.g., Key L 718, including a number of less significant bits (e.g., least significant bits), such as 1-5). In some examples, the first subset of bits of a root and/or branch node combined with the second subset of bits of the root and/or branch node correspond to a key, a segment of keys, an address (e.g., LBA or PBA), and/or a segment of addresses. For another example of elements in a node, each element of a leaf node of tree 700 can include a fragment length (756), a first subset of bits (e.g., OB H 758, including a number of more significant bits (e.g., most significant bits), such as 1-5), and/or a second subset of bits (e.g., OB L 760, including a number of less significant bits (e.g., least significant bits), such as 1-5). In some examples, the first subset of bits of a leaf node combined with the second subset of bits of the leaf node correspond to a key and/or a value (e.g., an address (e.g., LBA or PBA)). In such examples, the value can be run length encoded and require the fragment length to be properly identified.
As mentioned above, in some examples, a database (e.g., database 300 and/or database 400) is structured to have nodes with a fixed relationship with each other node. In such examples, arithmetic can be used to move from one node to another. For example, in
Using the formula, the number [0 . . . 32] can change based on a number of branch and/or leaf nodes for a current node.
Referring to
In some examples, the first search returns vector 0 (indicated by arrow 726 pointing to left of element 714), which using the formula above results in identifying branch 726 (sometimes referred to as node 1, as identifier for branch 726 can be 1). As a result of identifying branch 726, data related to branch 726 is prefetched, and a second search (e.g., another binary search) is performed on keys of branch 726. The prefetched data related to branch 726 can includes (1) the keys of branch 726 and (2) keys of branch nodes of branch 726.
In some examples, the second search returns vector 1 (indicated by arrow 732 pointing to right of element 728 and left of element 730), which using the formula above results in identifying branch 738 (sometimes referred to as node 34, as identifier for branch 738 can be 34). As a result of identifying branch 738, data related to branch 738 is prefetched, and a third search (e.g., another binary search) is performed on keys of branch 738. The prefetched data related to branch 738 can include (1) the keys of branch 738 and (2) keys and/or values of leaf nodes of branch 738.
In some examples, the third search returns vector 2 (indicated by arrow 740 pointing to right of element 742 and left of element 744), which using the formula above results in identifying leaf 754 (sometimes referred to as node 1125, as identifier for leaf 754 can be 1125). As a result of identifying leaf 754, a fourth search (e.g., another binary search) is performed on keys of leaf 754 to identify the desired key, which can be used to obtain a corresponding value (e.g., a run length encoded value identified using a fragment length, OB H 758, and OB L 760 corresponding to the desired key). It should be recognized that, while binary searches were used to search through keys in the discussion above, any type of search can be used and that the searches are used to narrow down the search space iteratively (e.g., the search space is divided into segments and keys corresponding to each segment is searched instead of the entire search space).
In some examples, an element of a node of tree 800 includes a key and/or a value. For example, each element of a root and/or branch node of tree 800 can include a first subset of bits (e.g., “04” in 812, including a number of more significant bits (e.g., most significant bits), such as 1-5) and/or a second subset of bits (e.g., “F0” in 812, including a number of less significant bits (e.g., least significant bits), such as 1-5). In some examples, the first subset of bits of a root and/or branch node combined with the second subset of bits of the root and/or branch node (e.g., “04F0” for 812, representing an LBA) correspond to a key, a segment of keys, an address (e.g., LBA or PBA), and/or a segment of addresses. For another example of elements in a node, each element of a leaf node of tree 800 can include a fragment length (e.g., “20” in 854, representing the fragment length in hexadecimal), a first subset of bits (e.g., “5” in 854, including a number of more significant bits (e.g., most significant bits), such as 1-5), and/or a second subset of bits (e.g., “75” in 854, including a number of less significant bits (e.g., least significant bits), such as 1-5). In some examples, the first subset of bits of a leaf node combined with the second subset of bits of the leaf node (e.g., “575” for 854, representing an LBA, such as a beginning of run length encoded data) correspond to a key and/or a value (e.g., an address (e.g., LBA or PBA)). In such examples, the value can be run length encoded and require the fragment length to properly identify.
As mentioned above, in some examples, a structure of a database (e.g., database 300 of
Referring to
In some examples, the first search (e.g., identifying where “0610” falls between keys of root 810) returns vector 1 (indicated by arrow 816 pointing to right of element 812 and left of element 814), which using the formula above (e.g., 0*5+1+1) results in identifying branch 830 (labeled as node 2, to indicate identifier for branch 830 is 2). As a result of identifying branch 830, data related to branch 830 is prefetched, and a second search (e.g., a binary search) is performed on keys of branch 830. The prefetched data related to branch 830 can include (1) the keys of branch 830 and (2) keys and/or values of leaf nodes of branch 830.
In some examples, the second search (e.g., identifying where “0610” falls between keys of branch 830) returns vector 2 (indicated by arrow 836 pointing to right of element 832 and left of element 834), which using the formula above (e.g., 2*5+1+2) results in identifying leaf 850 (labeled as node 13, to indicate identifier for leaf 850 is 13). As a result of identifying leaf 850, a third search (e.g., another binary search) (e.g., a size search) is performed to identify the desired key, which can be used to obtain a corresponding value (e.g., a run length encoded value identified using a fragment length (e.g., “20” in 854), OB H (e.g., “5” in 854), and OB L (e.g., “75” in 854) corresponding to the desired key).
In some examples, the third search (e.g., identifying where “0610” falls in leaf 850) returns vector 1 (indicated by arrow 856 pointing to right of element 852 and left of element 854). Using element 854 (identified by the third search), an OB can be computed to obtain the result of the search for the desired key. The OB can be computed using the following equation:
For this equation: (1) node[vector].OB is “0x0575” (referring to combining “5” and “75” in element 854); (2) key is 0x0610 (referring to the desired key); (3) PrevEnt(node[vector].key) is “0x0600” (referring to key from node 830 (e.g., referring to combining “06” and “00” in node 830)); and (4) the sum of the fragment sizes before node[vector] is “0x000C” (referring to fragment size in element 852, which is “OC”). The result of the equation is “0x0579 . . . 0x57E”.
It should be recognized that, while binary searches were used to search through keys in the discussion above, any type of search can be used and that the searches are used to narrow down the search space iteratively (e.g., the search space is divided into segments and keys corresponding to each segment is searched instead of the entire search space).
At 902, the computer system receives a search query. In some examples, the search query corresponds to and/or is for a physical storage device (e.g., volatile or non-volatile memory). In some examples, receiving the search query includes detecting input (e.g., user input) to perform a search. In some examples, the search query is received without user input (e.g., an application and/or software program sends a request to perform a search corresponding to the search query).
At 904, the computer system identifies a search space that is divided (e.g., fragmented) into a first number of portions. In some examples, each portion of the first number of portions is the same size. In some examples, the first number of portions is 1. In some examples, the first number of portions is 2 or more. In some examples, the search space is represented by a first number of bits. In some examples, the search space is divided by taking a first number of bits (e.g., a first number of most significant bits). In some examples, the search space is identified by performing a fourth search different from the first search, the second search, and the third search. In some examples, the fourth search is of a third number of portions, where a portion of the third number of portions is the search space. In some examples, the fourth search is a binary search. In some examples, the search space is a single track. In some examples, the search space is a single head. In some examples, search space is a single sector. In some examples, a single track includes the search space. In some examples, a single head includes the search space. In some examples, a single sector includes the search space. In some examples, the search space includes multiple silos, each silo including a tree data structure with a root node and a plurality of branch nodes followed by a plurality of leaf nodes. In such examples, a silo is first selected before performing one or more search techniques described herein. In some examples, the first number of portions is a first number of cache lines. In some examples, the search space is a single node. In some examples, a single node includes the first number of portions. In some examples, the search space is a root node of a tree structure. In some examples, the search space is a branch leaf of a tree structure. In some examples, the search space includes a single silo. In some examples, a single silo includes the search space. In some examples, the first number of portions is a first number of most significant bits of an LBA (e.g., corresponding to the physical storage device). In some examples, each portion of the first number of portions includes a high value and a low value. In some examples, the search space is an ordered data set.
At 906, the computer system performs, based on the search query, a first search of the first number of portions to identify a first portion (e.g., of the first number of portions). In some examples, performing the first search includes searching for a result of the search query. In some examples, performing the first search includes identifying a portion of the first number of portions that includes a result of the search query (e.g., the result is between a high value and a low value of the portion).
At 908, in response to performing the first search, the computer system prefetches (e.g., transfer from a first memory (e.g., a main memory, such as the physical storage device) to a second memory (e.g., a temporary storage)) a second number of portions corresponding to the first portion. In some examples, each portion of the second number of portions is the same size. In some examples, the second number of portions is 1. In some examples, the second number of portions is 2 or more. In some examples, the second number of portions is the same number of portions as the first number of portions. In some examples, the second number of portions is the same size as the first number of portions. In some examples, the second number of portions is a different size than the first number of portions. In some examples, the second number of portions is a different number of portions than the first number of portions. In some examples, the second number of portions is represented by a second number of bits different from the first number of bits. In some examples, the second number of portions is represented by the first number of bits. In some examples, the second number of portions are included in the first portion. In some examples, the second number of portions is a second number of cache lines (e.g., 1, 2, 4, 8, 16, or 32). In some examples, each portion (e.g., each cache line) of the second number of portions is prefetched into a different bank of DRAM (dynamic random access memory) space. In some examples, the second number of cache lines is the same as the first number of cache lines. In some examples, the second number of cache lines is different from the first number of cache lines. In some examples, the second number of portions is a single node. In some examples, a single node includes the second number of portions. In some examples, the second number of portions is a branch leaf of a tree structure. In some examples, the first number of portions is a second number (e.g., different from or the same as the first number) of most significant bits of an LBA (e.g., corresponding to the physical storage device). In some examples, each portion of the second number of portions includes a high value and a low value. In some examples, the second number of portions are prefetched at least partially in parallel.
At 910, the computer system performs, based on the search query, a second search (e.g., after performing the first search) of the second number of portions to identify a second portion (e.g., of the second number of portions), wherein the second search is different from the first search. In some examples, performing the second search includes searching for a result of the search query. In some examples, the second search includes identifying a portion of the second number of portions that includes a result of the search query (e.g., the result is between a high value and a low value of the portion).
At 912, after performing the second search (e.g., and without obtaining and/or prefetching another portion), the computer system performs a third search to identify a search result (e.g., a logical block address (LBA)) corresponding to the search query, wherein the third search is different from the second search. In some examples, the computer system identifies a physical address using the search result. In some examples, performing the third search includes searching for a result of the search query. In some examples, performing the third search includes identifying a portion that includes a result of the search query (e.g., the result is between a high value and a low value of the portion).
In some examples, the search result includes a key (e.g., a unique address corresponding to a respective associated value). In some examples, the key is used to obtain a corresponding value (e.g., a memory location in a physical storage device). In some examples, the search result includes a key when the search query is with respect to a key-value store.
In some examples, the search result includes a range of memory (e.g., a fragment and/or portion of memory). In some examples, a respective search result of the first search and/or the second search includes one or more keys while the search result does not include one or more keys. In some examples, the range varies in size for different searches such that different search queries result in search results with different ranges. In some examples, the search result includes a range of memory when the search query is performed with respect to a run-length encoded store.
In some examples, the search space includes a tree structure to store data. In some examples, the tree structure includes at least one branch node that is fully packed and at least one leaf node that is not fully packed (e.g., a fully packed node is when both a left and a right child of the node is present and/or not null). In some examples, the tree structure includes a plurality of branch nodes and a plurality of leaf nodes. In some examples, all branch nodes of the tree structure are fully packed. In some examples, one or more leaf nodes of the tree structure are not fully packed. In some examples, the tree structure is a binary tree, a binary search tree, and/or a balanced search tree.
In some examples, the first number of portions are located in a first predefined area of memory. In some examples, the second number of portions are located in a second predefined area of memory such that the second number of portions are identified using arithmetic (e.g., and without using a pointer). In some examples, the search space includes a plurality of nodes having a fixed relationship to each other.
In some examples, data in the second portion is continuous in a logical block address (LBA) space. In some examples, data corresponding to the second portion is continuous in a physical block space (PBA). In some examples, the data in the second portion includes a plurality of keys. In such examples, the plurality of keys is adjacent to each other in the LBA space and/or the PBA space such that there is not data other than a key between two other keys in the plurality of keys. In some examples, a value corresponding to a key is not stored adjacent to the key and another key in the LBA space and/or the PBA space.
In some examples, a size of a portion of the first number of portions is different than a size of a portion of the second number of portions (e.g., memory size or footprint) (e.g., an unbalanced or asymmetrical structure).
In some examples, the first search, the second search, and the third search are binary searches. In some examples, the searches may include sequential search (e.g., a linear search) or interval searches (e.g., a logarithmic search).
Note that details of the processes described above with respect to method 900 (e.g.,
Attention is now directed towards techniques for organizing databases. Such techniques are described with respect to writing data to a physical storage device. However, it should be recognized that other contexts can be used with techniques described herein. For example, a data structure re-organized without respect to writing data can use techniques described herein. In addition, some techniques optionally complement or replace other techniques for organizing databases.
In
While illustrated as a tree data structure, the process described below can be used for other types of data structures, such as a linear, graph, or hash data structure. In some examples the data structure can manage storage in a database (e.g., a physical storage device) as described above. In such examples, the configuration of the database can be the same as database 300 of
Referring to tree 1000, root node 1010 includes multiple elements (e.g., elements 1012, 1014, 1016, and 1018). Such elements can represent branch or leaf nodes of root node 1010. For example, element 1012 of root node 1010 can reference an element (e.g., element 1012 and/or 1030) in leaf node 1028, allowing a search of elements in root node 1010 to identify a leaf node. In such an example, element 1012 of root node 1010 can reference a first element in leaf node 1028 such that, when searching root node 1010 for a search query, leaf node 1019 results from identifying that the search query is less than element 1012, and leaf node 1028 results from identifying that the search query is equal to or more than element 1012 but less than element 1014 (e.g., as illustrated adjacent to element 1012 in root node 1010). Taking this example further, root node 1010 includes four different elements (e.g., elements 1012, 1014, 1016, and 1018), allowing a search as described above to result in identifying one of five different nodes. It should be recognized that other organizations can be used, such as element 1012 of root node 1010 can be located in the beginning of leaf node 1019 so that element 1012 is a minimum reference with respect to leaf nodes 1020-1040.
Referring to tree 1000, a leaf node (e.g., leaf nodes 1019, 1028, 1032, 1036, and/or 1040) includes one or more elements (e.g., elements 1020, 1022, 1024, and 1026 with respect to leaf node 1019) (sometimes referred to as a data element to distinguish from a void element). In some examples, an element is any type of data, including a set of bits, a pointer, a string, a number, and/or the like. For example, an element can include a key (e.g., a unique value to represent the element) and a value (e.g., data corresponding to the element).
As mentioned above, tree 1000 does not include any void elements (sometimes referred to as being a fully packed tree and/or fully packed set of one or more nodes). In some examples, void elements include portions of a data structure (e.g., tree 1000) that are unused, empty, blank, voided, and/or not used by the data structure. In such examples, tree 1000 not including any void elements represents that all elements in tree 1000 include data that is used by tree 1000. In some examples, when no void elements are present, adding additional elements to tree 1000 requires either deleting an existing element and/or making tree 1000 larger (e.g., take up more memory to fit the additional elements).
Referring to tree 1000,
As mentioned above, tree 1046 is tree 1000 after adding element 1044 to tree 1000. As illustrated in
In
While illustrated as a tree data structure, the process described below can be used for other types of data structures, such as a linear, graph, or hash data structure. In some examples the data structure can manage storage in a database (e.g., a physical storage device) as described above. In such examples, the configuration of the database can be as illustrated in
Referring to tree 1100, root node 1110 includes multiple elements (e.g., elements 1114, 1116, 1118, and 1154). Similar to as described above with respect to
Referring to tree 1100, a leaf node (e.g., leaf nodes 1120, 1128, 1136, 1144, and/or 1152) includes one or more elements (e.g., elements 1112, 1122, 1124, and 1126 with respect to leaf node 1120). In some examples, zero or more of the one or more elements are data elements and zero or more of the one or more elements are void elements. In such examples, a data element is any type of data of a data structure (e.g., tree 1100), including a set of bits, a pointer, a string, a number, and/or the like, and a void element is a portion of the data structure that is unused, empty, blank, voided, and/or not used by the data structure. For example, a data element can include a key (e.g., a unique value to represent the element) and a value (e.g., data corresponding to the element), and a void element can be a default value for a general void element.
The presence of one or more void elements is sometimes referred to as not being a fully packed tree and/or not a fully packed set of one or more nodes). In some examples, when a void element is present, adding additional data elements to tree 1100 does not require deleting an existing data element and/or making tree 1100 larger (e.g., take up more memory to fit the additional data elements). Instead, a void element is replaced with a data element to make room for the additional data element as described further below.
In some examples, a leaf node does not include a void element but an adjacent leaf node of the leaf node includes a void element. In such examples, the void element in the adjacent leaf node can be shifted (e.g., to the right and/or to the left depending on which direction the adjacent leaf node is with respect to the leaf node (e.g., moved to the right if the adjacent leaf node is to the right and moved to the left if the adjacent leaf node is to the left), moved, and/or re-ordered to have the void element included in the leaf node and be able to replaced by a data element to make room in the leaf node for the additional data element. Such shifting can be similar to as described above with respect to
Referring to tree 1100,
As mentioned above, tree 1164 is tree 1100 after adding element 1162 to tree 1100. As illustrated in
While root node 1166 is not different from root node 1110 as a result of adding element 1162 to tree 1100, leaf node 1168 is changed relative to leaf node 1120. For example, element 1162 is inserted into the second position of leaf 1168 (e.g., as a result of element 1162 being greater than element 1112 and less than element 1122). As a result of element 1162 being inserted into the second position of leaf 1168, elements 1122 and 1124 are shifted to the right such that element 1122 is in the third position of leaf 1168 and element 1124 is in the fourth position of leaf 1168 (which previously, in leaf 1120, included void element 1126). It should be recognized that other re-organizations of leaf node 1120 can occur depending on the scheme and where element 1162 fits within leaf node 1168 but that root node 1166 should not be modified when there are available void elements in an affected leaf node (e.g., a leaf node for which a new element is being added). In some examples, shifting elements 1122 and 1124 within leaf node 1168 as opposed to shifting a root node and/or other leaf nodes (as described above with respect to
In some examples, additional data elements can be added to a leaf node that is fully packed (e.g., leaf node 1168). In such examples, an adjacent leaf node with a void element resulting in the least amount of movement and/or changes can be identified and used for adding the additional data elements. For example, if two additional data elements are to be added to leaf node 1174 after element 1146 and before 1148, only one of the two additional data elements would fit into leaf node 1174 as illustrated in
In some examples, to avoid the situation illustrated in
As mentioned above, the first step of the process of
Referring to representation 1200, used leaves 1202 include multiple leaves (e.g., leaves 1206, 1284. and/or 1208), and unused leaves 1204 include multiple leaves (e.g., leaves 1210 and/or 1212). In representation 1200, there are 20 used leaves and 10 unused leaves. It should be recognized that there can be more or fewer used leaves and/or unused leaves (including a single used and/or a single unused leaf).
As illustrated, each used leaf in used leaves 1202 of representation 1200 includes a letter and a number. The letter refers to whether a used leaf is static (uses “S”) or dynamic (uses “D”). In some examples, a static node is a leaf node that has not been updated for a predefined amount of time. In some examples, a dynamic node is a leaf node that has been updated within the predefined amount of time. In representation 1200, there are 6 static nodes and 14 dynamic nodes. The number following the letter refers to number of void elements in a leaf node. For example, leaf node 1206 is a static leaf node with 1 void element.
For the first step, multiple calculations can be performed to determine whether one or more sets of void elements should be added to the tree.
One calculation can include calculating a number of void elements expected for the tree. The equation for the number of void elements expected for the tree can be (BST_VOIDS_IN_DYNAMIC*(numLeaves−numStats)+BST_VOIDS_IN_STATIC*numStats)), where BST_VOIDS_IN_DYNAMIC is the number of void elements required in a dynamic node, numLeaves is the number of leaves in the tree, numStats is the number of of static nodes in the tree, and BST_VOIDS_IN_STATIC is the number of void elements required in a static node. In the example depicted in
Another calculation can include calculating a number of void elements needed for the tree. The equation for the number of void elements needed can be the number of void elements expected for the tree (e.g., the previous equation) minus the number of void elements in the tree. In the example depicted in
Another calculation can include calculating the number of sets of void elements (e.g., FVLs) needed for the tree. The equation for the number of sets of void elements needed for the tree can be the result rounded up of the number of number of void elements needed for the tree (e.g., the previous equation) divided by the number of entries (e.g., the number of elements in a leaf node minus the number of void elements required in a dynamic node, or, in some examples, just the number of leaf elements in a leaf nodes). In the example depicted in
As mentioned above, the second step of the process of
For adding the one or more sets of void elements, the equations discussed above can be used, resulting in two sets of void elements added to the tree. In some examples, the void elements are added to a particular location in the tree (e.g., beginning, end, middle, and/or dispersed (e.g., evenly or not evenly) within the tree). As illustrated in
For determining where to distribute the one or more sets of void elements in the tree, a summation equation can be used with respect to each leaf node in used leaves 1216 of representation 1214. The summation equation can include going from one leaf node to another leaf until identifying a location in which additional void elements are needed. In one example, the summation equation can be the summation of the difference of number of void elements in every previous leaf element by the required number of void elements for the particular type of leaf node. For example, leaf node 1224 of representation 1214 can be a dynamic leaf node with four void elements, and, if starting with right-most leaf node and based on the number of void elements required in a dynamic node described above, the summation equation would result in 4−3=1 (as shown in field 1228 of representation 1226). Continuing the example, leaf node 1284 of representation 1214 can be a static leaf node with four void elements and, based on the number of void elements required in a static node described above, the summation equation would result in 1+(4−1)=4 (as shown in field 1286 of representation 1226). As long as the summation equation continues to be above a threshold (e.g., positive and/or some other threshold), it can be determined that additional void elements are not needed. Accordingly, at leaf node 1222 of representation 1214, the summation equation can equal−2, indicating that additional void elements are needed based on it being below the threshold (e.g., a negative number). Based on the summation equation equaling −2, leaf node 1222 of representation 1213 can be determined to be the location in which additional void elements are needed.
As mentioned above, the third step of the process of
For moving at least one of the sets of void elements to a location within the tree, the location can correspond to the location determined in the second step of the process of
For continuing to determine where to distribute remaining sets of void elements in the tree, the summation equation can continue to be used similar to as described above with respect to representation 1214 and 1226. For example, leaf node 1244 of representation 1232 can be a dynamic leaf node with 32 void elements (e.g., a full void leaf0 and, based on the number of void elements required in a dynamic node described above, the summation equation would result in 1+(32−3)=30 (as shown in field 1288 of representation 1248). As long as the summation equation continues to be above the threshold, it can be determined that additional void elements are not needed. Accordingly, at leaf node 1240 of representation 1232 after skipping leaf node 1242 because it is not counted in the summation equation, the summation equation can equal 27 (30+(0−3)=27), which is above the threshold. Continuing to leaf node 1238 of representation 1248, the summation equation can return −2, indicating that additional void elements are needed based on it being below the threshold. Based on the summation equation equaling −2, leaf node 1238 of representation 1232 can be determined to be the location in which additional void elements are needed.
As mentioned above, the fourth step of
While particular equations are described above, it should be recognized that different equations can be used in some examples. For example, a number of void elements needed for each leaf node can be calculated and, when additional void elements are needed, a set of void elements can be added without respect to previous leaf elements.
In some examples, after distributing the sets of void elements to the tree, individual void elements can be added to leaf nodes with data elements (e.g., this process sometimes referred to as melding). In some examples, melding occurs from left to right in the tree and moves elements between leaf nodes, as illustrated and described with respect to
The block diagram of
In some examples, the block diagrams of
The block diagram in
As illustrated in
As illustrated in
As illustrated in
It should be recognized that pattern 1316 in first node 1306 of
As illustrated in
As illustrated in
It should be recognized that pattern 1316 in second node 1308 of
As illustrated in
As illustrated in
As illustrated in
It should be recognized that pattern 1316 in third node 1310 of
As illustrated in
As illustrated in
It should be recognized that pattern 1316 in beginning (e.g., left side) of fourth node 1312 of
As illustrated in
In some examples, the melding process ends with positive void balance. In such examples, the melding process can return void elements to numUU 1304 (which is illustrated in
At 1402, the computer system receives a request to add first data to memory (e.g., volatile or non-volatile memory) (e.g., a physical storage device) (e.g., a request to update the memory to include the first data). In some examples, receiving the request include detecting input (e.g., user input) to add the first data to the memory. In some examples, the request is received without user input (e.g., an application and/or software program sends the request).
At 1404, in response to receiving the request to add the first data to the memory, the computer system identifies a first node in a tree structure (e.g., a memory tree). In some examples, the first node is a leaf node. In some examples, the tree structure indicates where data is stored in the memory. In some examples, a first level of the tree structure includes a different number of nodes than a second level of the tree structure. In some examples, a second node of the tree structure includes a different number of children nodes than a third node of the tree structure. In some examples, the first node is a leaf node. In some examples, the second node is a branch node. In some examples, the second node is a leaf node. In some examples, the first node is identified via a search of the tree structure. In some examples, the first node is identified based on a key corresponding to the first data being between a low value and a high value of the first node.
At 1406, in response to receiving the request to add the first data to the memory, the computer system identifies a first location within the first node. In some examples, key values before the first location are less than a key value corresponding to the first data. In some examples, when identifying the first location, a key value corresponding to the first location is higher than a key value corresponding to the first data. In some examples, the first location is identified via a search of the tree structure. In some examples, the first location is identified when identifying the first node.
At 1408, in response to receiving the request to add the first data to the memory, the computer system shifts second data in the first node from a first location in the first node to a second location in the first node, wherein the second location is different from the first location. In some examples, the first node includes the first location and the second location before receiving the request to add the first data to the memory. In some examples, shifting the second data from the first location to the second location includes copying and/or moving the second data from the first location to the second location. In some examples, the second data is shifted to the right in the memory. In some examples, the second location is and/or includes unused memory in the first node. In some examples, the second location is and/or includes a void element. In some examples, the first node is continuous memory that includes the first location and the second location. In some examples, the first node consists of keys. In some examples, the first node is a continuous stream of keys. In some examples, values corresponding to keys stored in the first node are located in a different portion of memory.
At 1410, in response to receiving the request to add the first data to the memory, the computer system adds (e.g., write) (e.g., after shifting the second data in first node to the second location in the first node) the first data to the first location. In some examples, adding the first data to the first location includes forgoing updating a branch node corresponding to the first node.
In some examples, the tree structure includes a third node and a fourth node different from the third node. In some examples, the third node includes a different number of void elements than the fourth node. In some examples, each of the third node and the fourth node is a leaf node of the tree structure (e.g., nodes without children). In some examples, the number of void elements in the third node and the fourth node are the same.
In some examples, in response to receiving the second request to add the second data to the memory, the computer system identifies a fifth node in the tree structure. In some examples, in response to receiving the second request to add the second data to the memory, in accordance with a determination that the fifth node does not include a void element, and that a sixth node in the tree structure includes a respective void element, the computer system shifts third data from a location in the fifth node to a location in the sixth node. In some examples, the location in the sixth node corresponds to the respective void element in the sixth node. In some examples, the location in the sixth node does not correspond to the respective void element in the sixth node and instead fourth data from a location in the sixth node is shifted to a location in the sixth node corresponding to the respective voice element in the sixth node. In some examples, in response to receiving the second request to add the second data to the memory, in accordance with a determination that the fifth node does not include a void element, that the sixth node does not include a void element, and that a seventh node in the tree structure includes a respective void element, the computer system shifts fifth data (e.g., the third data or different data) from a location in the fifth node to a location in the seventh node. In some examples, the computer system updates a state of the tree structure to reflect shifting the third data (e.g., a branch node of the tree structure is modified and/or updated (e.g., a key, of the branch node, that corresponds to a respective node (e.g., a leaf node) of the tree structure is changed from a first value to a second value)).
In some examples, in accordance with a determination that the tree structure needs additional void elements, the computer system adds one or more void elements to the tree structure at a predetermined location (e.g., the end and/or after a current last element of tree structure) of the memory. In some examples, the one or more void elements includes a predefined number of void elements that is not based on a size of the tree structure and/or a node of the tree structure. In some examples, the one or more void elements includes a predefined number of void elements that is based on a size of the tree structure and/or a node of the tree structure. In some examples, in accordance with a determination that the tree structure does not need additional void elements, forgoing adding a void element to the tree structure.
In some examples, the tree structure includes an eighth node and a ninth node different from the eighth node. In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory and in accordance with a determination that the eighth node needs an additional void element, the computer system adds, using the one or more void elements, a first number of void elements to the eighth node. In some examples, the first number of void elements are added to the end of the eighth node. In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory and in accordance with a determination that the eighth node needs an additional void element, the computer system modifies (e.g., based on adding the first number of void elements) a value (e.g., a key) of a ninth node (e.g., a branch node of the eighth node) (e.g., the eight node is a leaf node of the ninth node). In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory and in accordance with a determination that the eighth node does not need an additional void element, the computer system forgoes adding the first number of void elements to the eighth node. In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory and in accordance with a determination that the eighth node does not need an additional void element, the computer system forgoes modifying the value of the ninth node.
In some examples, in accordance with a determination that a tenth node, different from the eighth node, needs an additional void element, the computer system adds, using the one or more void elements, a second number of void elements to the tenth node, wherein the second number is different from the first number. In some examples, the second number of void elements are added to the end of the eighth node.
In some examples, the tree structure includes an eleventh node and an twelfth node different from the eleventh node. In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory, the computer system adds, using the one or more void elements, a third number of void elements to the eleventh node. In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory, the computer system adds, using the one or more void elements, the third number of void elements to the twelfth leaf node.
In some examples, the one or more void elements are added to the tree structure in response to a determination that a first computer system is idle. In some examples, adding the first number of void elements to the eighth node, the second number of void elements to the tenth node, the third number of void elements to the eleventh node, and/or the third number of void elements to the twelfth node occurs in response to a determination that the computer system is idle. In some examples, the computer system is executing the tree structure.
In some examples, in accordance with a determination that a respective node (e.g., the first node, the second node, the eighth node, the ninth node, or a different node) in the tree structure includes less than a predetermined number of void elements, the computer system requests, by the respective node, one or more additional void elements, wherein determining whether the eighth node needs an additional void element includes determining whether the eighth node has requested one or more additional void elements.
In some examples, before adding the one or more void elements to the tree structure, the computer system calculates, based on a plurality of nodes of the tree structure, a number of void elements to add to the tree structure, wherein the one or more void elements includes the number of void elements. In some examples, the number of void elements included in the one or more void elements is a default number that is not based on the tree structure. In some examples, the calculating is based on a single node of the tree structure.
In some examples, after adding the one or more void elements to the tree structure at the predetermined location of the memory and while performing a process to add the one or more void elements to one or more nodes in the tree structure, the computer system determines that a predefined time threshold corresponding to the process has been reached. In some examples, in response to determining that the predefined time threshold has been reached, the computer system causes the process to be terminated (e.g., immediately or after adding one or more void elements to a current node in the tree structure) before adding a void element to a respective node in the tree structure. In some examples, the respective node has requested an additional void element. In some examples, the process is terminated in accordance with a determination that the respective node needs an additional void element.
In some examples, after causing the process to be terminated and in accordance with a determination that a second computer system is idle, the computer system continues the process.
Note that details of the processes described above with respect to method 1400 (e.g.,
The foregoing description, for purpose of explanation, has been described with reference to specific examples. However, the illustrative discussions above are not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Many modifications and variations are possible in view of the above teachings. The examples were chosen and described in order to best explain the principles of the techniques and their practical applications. Others skilled in the art are thereby enabled to best utilize the techniques and various examples with various modifications as are suited to the particular use contemplated.
Although the disclosure and examples have been fully described with reference to the accompanying drawings, it is to be noted that various changes and modifications will become apparent to those skilled in the art. Such changes and modifications are to be understood as being included within the scope of the disclosure and examples as defined by the claims.
The present application claims priority to U.S. Provisional Patent Application Ser. No. 63/526,644, entitled “TECHNIQUES FOR MANAGING DATA” filed Jul. 13, 2023, which is hereby incorporated by reference in its entirety for all purposes.
Number | Date | Country | |
---|---|---|---|
63526644 | Jul 2023 | US |